Last active
December 18, 2015 02:48
-
-
Save AAlfare/5713385 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.form .field.pageselect { | |
margin-right: -20px; } | |
.form .field.pageselect select { | |
display: block; | |
margin-top: -2px; | |
width: 100%; | |
margin-bottom: 5px; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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