17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1891 Views |
-
Adding a custom tab into CMS

12 March 2008 at 10:46am Last edited: 12 March 2008 10:47am
I sware this should be easier than it looks, i simply cannot find how to do this? ive looked through the forums, all the documentation, please tell me im blind.
How do you add a custom tab into the CMS with a content area the same as the first tab?
Cheers
-
Re: Adding a custom tab into CMS

12 March 2008 at 11:01am
Have a look at tutorial 2: Extending a basic site: http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site
-
Re: Adding a custom tab into CMS

12 March 2008 at 11:25am Last edited: 12 March 2008 12:33pm
For some reason, this isnt creating the tab 'RightCol'. Ive read the tutorial 3 times.
class HomePage extends Page {
static $db = array(
'SideText' => 'HTMLText'
);
}class HomePage_Controller extends Page_Controller {
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.RightCol', new TextField('SideText'));
return $fields;
}
} -
Re: Adding a custom tab into CMS

12 March 2008 at 8:53pm
Hi
You have specified the data-type of db field SideText as HTMLText but then declared a new form-field of the type TextField. This should really be of the type HTMLEditorField if you want the form to display HTML.
That might be why the tab isn't being rendered... -
Re: Adding a custom tab into CMS

14 March 2008 at 11:31am
Thanks for all the help guys, i simply had the getCMSFields function under the wrong class.
| 1891 Views | ||
|
Page:
1
|
Go to Top |



