Jump to content

how to give permission to a guest to add a specific page.


dhruba
 Share

Recommended Posts

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>
 
  • Like 3
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...