"Edit This Page" code snippet / component

Insert this code snippet wherever you want in your template:


	<?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...)

To use in a component, the code to insert would be:


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

(Then insert <?php get_component('component-name'); ?> somewhere in your template.)

blog comments powered by Disqus