GetSimple Support Forum
"Edit this page" snippet - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Scripts & Components (http://get-simple.info/forums/forumdisplay.php?fid=11)
+--- Thread: "Edit this page" snippet (/showthread.php?tid=2982)



"Edit this page" snippet - Carlos - 2012-03-24

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 } ?>



RE: "Edit this page" snippet - lukoie - 2013-03-31

thats the one! cheers mate!


RE: "Edit this page" snippet - shawn_a - 2013-04-01

You can use my component hook plugin to insert this automatically anywhere you want, front end hook wise.


RE: "Edit this page" snippet - bigthanks - 2015-12-04

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.


RE: "Edit this page" snippet - Carlos - 2015-12-04

Try changing cookie_check() by is_logged_in() and let me know...


RE: "Edit this page" snippet - bigthanks - 2015-12-04

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)