Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Adding a custom tab into CMS

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2028 Views
  • F4LLEN
    Avatar
    Community Member
    4 Posts

    Adding a custom tab into CMS Link to this post

    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

  • saimo
    Avatar
    Community Member
    67 Posts

    Re: Adding a custom tab into CMS Link to this post

    Have a look at tutorial 2: Extending a basic site: http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site

  • F4LLEN
    Avatar
    Community Member
    4 Posts

    Re: Adding a custom tab into CMS Link to this post

    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;
    }
    }

  • F4LLEN
    Avatar
    Community Member
    4 Posts

    Re: Adding a custom tab into CMS Link to this post

    can anyone tell me why this isnt working?

  • spenniec
    Avatar
    Community Member
    37 Posts

    Re: Adding a custom tab into CMS Link to this post

    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...

  • F4LLEN
    Avatar
    Community Member
    4 Posts

    Re: Adding a custom tab into CMS Link to this post

    Thanks for all the help guys, i simply had the getCMSFields function under the wrong class.

    2028 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.