dhruba Posted July 31, 2013 Share Posted July 31, 2013 Hi I want give a spacial permission to guest to add a specific page without entering in the admin panel. THANKS Link to comment Share on other sites More sharing options...
diogo Posted July 31, 2013 Share Posted July 31, 2013 This doesn't have anything to do with permissions, since you don't want to use the admin. The process for this is triggering the PHP code, usually by submitting a form. Here is a very simple example: <?php // on the top of the template file, before any code that echoes content if($input->post->submit){ $title = $sanitizer->text($input->post->title); $p = new Page(); $p->template = $templates->get("basic-page"); $p->parent = $pages->get(1); $p->title = $title; $p->save(); } ?> <!-- later on, echo this form --> <form name="input" method="post"> title: <input type="title" name="title"> <input type="submit" value="Submit" name="submit"> </form> 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now