Snippets - Little bits of code to make you happy
Create an 'Edit this page' Link
Tweet| | | Supports v2.4, v2.3
For some sites you may want your client to be able to click a link on a particlar page and be taken strait to that page in the admin area. Here's what a link that does just that would look like:
<a href="admin/show/{$ID}" title="edit this page">Edit this page</a>
If you wanted this to only show up when a user is logged in you could use the CurrentMember call to check. So it would look like this:
<% if CurrentMember %>
<a href="admin/show/{$ID}" title="edit this page">Edit this Page</a>
<% end_if %>
You could also take this a step further and write a function in your page controller to check whether the current user has permission to access the CMS using Permission::check('CMS_ACCESS_CMSMain') call.
Comments
RSS feed for comments on this page RSS feed for all comments
No one has commented on this page yet.
Post a comment ...
You cannot post comments until you have logged in. Login Here.