Skip to content

Instantly share code, notes, and snippets.

@AAlfare
Last active December 18, 2015 02:48
Show Gist options
  • Save AAlfare/5713385 to your computer and use it in GitHub Desktop.
Save AAlfare/5713385 to your computer and use it in GitHub Desktop.
<?php if(!defined('KIRBY')) exit ?>
title: Event
pages: false
files: true
fields:
title:
label: Title
type: text
course:
label: Event location
type: pageselect
path: mypage/locations
text:
label: Text
type: textarea
size: large
.form .field.pageselect {
margin-right: -20px; }
.form .field.pageselect select {
display: block;
margin-top: -2px;
width: 100%;
margin-bottom: 5px; }
<?php
global $site;
$pages = (isset($path) ? $site->pages->find($path)->children() : NULL);
?>
<select name="<?php echo $name ?>">
<option value="">Please select a page...</option>
<?php foreach($pages AS $page): ?>
<option<?php if($page->uid() == $value) echo ' selected="selected"' ?> value="<?php echo h($page->uid()) ?>"><?php echo h($page->title()) ?></option>
<?php endforeach ?>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment