Skip to content

Instantly share code, notes, and snippets.

@ian-cox
Created February 13, 2015 20:19
Show Gist options
  • Save ian-cox/1c6eeedb48e4250a346b to your computer and use it in GitHub Desktop.
Save ian-cox/1c6eeedb48e4250a346b to your computer and use it in GitHub Desktop.
Adding panel fields to front end Kirby templates
<?php if($user = $site->user() and $user->hasRole('admin')):?>
<form autocomplete="off" class="form" method="post" action="/panel/api/pages/update/<?php echo kirby()->request()->path();?>">
<label class="label" for="form-field-title">Title</label>
<input autocomplete="on" class="input" id= "form-field-title" name="title" required="" type="title" value="<?php echo $page->title() ?>">
<input type="submit" value="Save">
</form>
<?php endif;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment