Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Edit this page" snippet
#1
Insert this code snippet wherever you want in your template:

Code:
<?php if (cookie_check()) { ?>
<a href="<?php get_site_url();echo $GSADMIN;?>/edit.php?id=<?php get_page_slug();?>">Edit this page</a>
<?php } ?>

You'll have an "Edit page" link in frontend pages if you're logged in. For GetSimple 3.1+

(Of course you can customize how the link is rendered by editing the non-php part...)

Update: To use in a component, the code would be:
Code:
<?php if (cookie_check()) { ?>
<a href="<?php get_site_url();global $GSADMIN;echo $GSADMIN;?>/edit.php?id=<?php get_page_slug();?>">Edit this page</a>
<?php } ?>
Reply
#2
thats the one! cheers mate!
Reply
#3
You can use my component hook plugin to insert this automatically anywhere you want, front end hook wise.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
a question from a newbie:
This works well when in localhost but do not appear when online hosting. Why? (I already logged in). Please help, because this command is very helpful to me in dealing with many pages.
Reply
#5
Try changing cookie_check() by is_logged_in() and let me know...
Reply
#6
Solved. Apologize, it was my fault. I forgot to put get_footer (); on the template. But using is_logged_in () can be work too. Once again sorry and thank you for your time.
GS is very impressive (y)
Reply




Users browsing this thread: 1 Guest(s)