Skip to content

Instantly share code, notes, and snippets.

@chillu
Created April 16, 2013 14:45
Show Gist options
  • Save chillu/5396502 to your computer and use it in GitHub Desktop.
Save chillu/5396502 to your computer and use it in GitHub Desktop.
class NewsPage extends Page {
static $db = array(
'SidebarTextAboveImage' => 'Text',
'SidebarTextBelowImage' => 'Text',
);
static $has_one = array(
'SidebarImage' => 'Image'
);
}
$Content
<div class="sidebar">
$SidebarTextAboveImage
$SidebarImage
$SidebarTextBelowImage
</div>
class PortfolioPage extends Page {
static $db = array(
'SidebarJobAds' => 'Text',
'SidebarJobAdsHeight' => 'Int'
);
// Duplicates relation, porfolio has sidebar images
// but doesn't allow text. But it has job ads.
static $has_one = array(
'SidebarImage' => 'Image',
);
}
$Content
<div class="sidebar">
$SidebarImage
$SidebarJobAds
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment