We've got our admin area to administer articles but it's not working fully yet.
If I click on a link to an article we get a page not found error.
This is because when we created this page by copying the main index page we didn't change this link
to the individual article page.
We don't want to link to this page as this would take us out of the admen section.
So that's copy the individual article page from the root.
And paste it in the admin folder.
That's change.
These require lines as we did with the admin index and also where were including the header
and footer.
We also need to restrict access to this page as this is for administrators only which will do at the
top by calling the required log in method on the Artha class like that.
Now if we click on an article in the admin index we see this new page the edit and delete links are
broken however.
This is because the edit and delete scripts are still in the root of the site.
Let's move them to the admin folder.
On the edit page.
As with the individual article page we need to change these four includes.
And also where we are including the shared article farm here.
Let's also require luggin for this page at the top.
We'll do the same with the delete articles script.
Changing the required lines and also requiring logging
back in the individual article scripts in The Root.
We can now remove these edit and delete links.
Let's give that a try.
If we view an article in the abdomen area let's edit it make a change and click save.
The change has been saved but we've been redirected back to the individual article page in The Root.
We can also see that the edit and delete links are no longer shown.
This is because after saving the changes the cold redirects to the article page in The Root.
Let's change this to the article page in the admin folder instead.
Like that.
Now if we edit an article
we're correctly redirected to the article page in the admin folder.
Let's also try deleting an article.
And again the article is deleted but were redirected back to the wrong index page.
It's the same issue as in the edit script so that's changed this redirect to go to the admen index instead.
Now when we delete an article we're redirected correctly.