I have my main content area and I also have two sidebar content areas. I want to know if I can load another pages content (reuse) into one or both of the sidebars using TreeDropdownField?
Right now I am trying this,
<?php
class Page extends SiteTree {
static $db = array(
'LeftSide' => 'HTMLText',
'RightSide' => 'HTMLText'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TreeDropdownField("LeftSide", "Choose a page to appear in the left sidebar:", "SiteTree"));
$fields->addFieldToTab('Root.Content.Main', new TreeDropdownField("RightSide", "Choose a page to appear in the right sidebar:", "SiteTree"));
return $fields;
}
static $has_one = array(
);
}
This just returns the page id in the sidebar instead of the actual page HTML.
Am I way off? Is this even possible.
Thanks in advance!
-Aaron