1267 Posts in 351 Topics by 486 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 851 Views |
-
New Page Type w/ Edittable Sidebar in CMS

14 January 2010 at 6:40pm
I have everything in here working except displaying the contents of the sidebar itself, i think i am missing some basic functionality of how the variables are passed.
My Page:
<?php
class PageWSidebar extends SiteTree {
public static $db = array("SideBar" => "HTMLText"
);
public static $has_one = array("SideBar" => "HTMLText"
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new HTMLEditorField ('SideBar', 'SideBar Content'));
return $fields;
}
}class PageWSidebar_Controller extends ContentController {
public function init() {
parent::init();Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}}
?>
and in my Theme I just have
<div class="foo"> $SideBar </div>
there's no errors, it just doesn't show anything that i type into the field in the cms
-
Re: New Page Type w/ Edittable Sidebar in CMS

15 January 2010 at 9:50am
I had to make it's parent Page, not the tree, so problem solved.
| 851 Views | ||
|
Page:
1
|
Go to Top |

