This file contains 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 | |
// get the main item for the detail page | |
// assuming you're getting the slug from the URL | |
$item = perch_collection('Case Studies', [ | |
'template' => 'case_studies/_detail', | |
'skip-template' => true, | |
'return-html' => true, | |
'filter' => 'slug', | |
'value' => perch_get('s'), |
This file contains 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
<article class="h-entry"> | |
<h1> | |
<a href="<perch:blog id="postURL" type="hidden" />" rel="bookmark" class="p-name"> | |
<perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" /> | |
</a> | |
</h1> | |
<p class="meta"> | |
<time class="dt-published" datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Publishing" />"> | |
<perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" /> | |
</time> |
This file contains 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 | |
/** | |
* Find a Collection Item by a field. If not exists, create new. | |
* | |
* @param string $collectionKey | |
* @param string $template | |
* @param array $field $field = ['id' => '', 'value' => ''] | |
* @param array $data | |
* @param boolean $return_item set to true to return item instead of _id | |
* |
This file contains 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 | |
return function(){ | |
$API = new PerchAPI(1, 'perch_members'); | |
$Members = new PerchMembers_Members($API); | |
$HTML = $API->get('HTML'); | |
$Lang = $API->get('Lang'); | |
$Paging = $API->get('Paging'); | |
$Paging->set_per_page(10); | |
$members = $Members->all($Paging); |