<?php $a = new Area('Main'); $a->disableControls(); $a->display($page); //or $cobj if using Concrete5.4.2.2 or lower ?>
"You want to edit the content you're seeing here on this page? Sure!
That's easy! Go to the sitemap, then expand the page that shows the content
you want to edit. Then find the sub-page that represents that content
and select it. Put it in Edit mode. Choose 'Properties' and go to
the 'Custom Attributes' area and look for a field labeled 'XXXX' and
enter your information there. It's EASY!"<?php defined('C5_EXECUTE') or die("Access Denied."); $title = $page->getCollectionName(); $date = $page->getCollectionDatePublic('n/j/Y'); ?> <div class="title"> <a href="<?php echo htmlentities($field_1_textbox_text, ENT_QUOTES, APP_CHARSET); ?>" target="_blank" title="<?php echo $title ?>"><?php echo $title; ?></a> </div><!-- End title --> <div class="source"> <?php echo (!empty($field_2_textbox_text)) ? htmlentities($field_2_textbox_text, ENT_QUOTES, APP_CHARSET) : 'Un-named Source'; ?> <br /> <?php echo t($date); ?> </div>
// Prepare data for each page being listed... $prType = $page->getAttribute('press_item_type'); $title = $th->entities($page->getCollectionName()); $date = date('F j, Y', strtotime($page->getCollectionDatePublic())); $class= ""; $class = ($count % 2 >0) ? "odd" : ""; $class.=" " . strtolower($prType);
<div class="pressItem<?php echo " " . $class; ?>"> <?php $a = new Area('Main'); $a->disableControls(); $a->display($page); ?> </div><!-- End pressItem -->
<?php /************************************************************ * DESIGNERS: SCROLL DOWN! (IGNORE ALL THIS STUFF AT THE TOP) ************************************************************/ defined('C5_EXECUTE') or die("Access Denied."); $pages = $cArray; $th = Loader::helper('text'); $count=1; //$ih = Loader::helper('image'); //<--uncomment this if generating thumbnails below //$nh is already set for us by the controller $showRss = false; if (!$previewMode && $controller->rss) { $showRss = true; $rssUrl = $controller->getRssUrl($b); $rssTitle = $th->entities($controller->rssTitle);
<?php defined('C5_EXECUTE') or die("Access Denied."); $title = $page->getCollectionName(); $date = $page->getCollectionDatePublic('n/j/Y'); ?> <div class="title"> <a href="<?php echo htmlentities($field_1_textbox_text, ENT_QUOTES, APP_CHARSET); ?>" target="_blank" title="<?php echo $title ?>"><?php echo $title; ?></a> </div><!-- End title --> <div class="source"> <?php echo (!empty($field_2_textbox_text)) ? htmlentities($field_2_textbox_text, ENT_QUOTES, APP_CHARSET) : 'Un-named Source'; ?> <br /> <?php echo t($date); ?> </div>
<?php defined('C5_EXECUTE') or die("Access Denied."); class PressRoomVideoBlockController extends BlockController { protected $btName = 'Press Room Video'; protected $btDescription = 'Block to add the necessary details for a Press Room Video link.'; protected $btTable = 'btDCPressRoomVideo'; protected $btInterfaceWidth = "700"; protected $btInterfaceHeight = "450"; protected $btCacheBlockRecord = true; protected $btCacheBlockOutput = true; protected $btCacheBlockOutputOnPost = true; protected $btCacheBlockOutputForRegisteredUsers = true; protected $btCacheBlockOutputLifetime = 300; public function getSearchableContent() { $content = array();
$title = $page->getCollectionName(); $date = $page->getCollectionDatePublic('n/j/Y');
$title = $controller->getBlockCollectionObject()->getCollectionName(); $date = $controller->getBlockCollectionObject()-getCollectionDatePublic('n/j/Y');
The single_page used the PageList API to retrieve all pages of that special page type, then for each of those pages I pulled out the first block who's blocktype handle started with a special prefix I used for the 3 custom blocktypes -- like this:
The advantages to this approach is that you can automatically tie in to search results (although you might not want people to ever see the individual item pages, in which case this point is moot). Also in my case I wanted to categorize the content so I created a custom attribute that could be assigned to each page that would put it into the appropriate category (I didn't include that code in my sample above because it would over-complicate things). Also also it provides a unified interface for the end-user -- they already know how to add pages and set page titles and choose custom attributes. The downside is that it's a bit on the complicated side in terms of code. Might be easier to just have user add blocks to the one "press room" page (although you'll need to figure out how to reverse-sort it and handle pagination).
I don't think there's an uber-simple way to do this (although if someone thinks of one I'd love to hear it as well).