Jump to:

5449 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Titles inside CMS tabs

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

Page: 1
Go to End
Author Topic: 1219 Views
  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Titles inside CMS tabs Link to this post

    In the CMS, by default in the "metadata" tab, there is a title "Search Engine Meta-tags". How can I add titles like these into my own CMS tabs that I am creating?

  • Ben Gribaudo
    Avatar
    Community Member
    181 Posts

    Re: Titles inside CMS tabs Link to this post

    Hi Dan,

    You can add a HeaderField form field when you build your CMS field set in getCMSFields.

    Ben

  • Artyom
    Avatar
    Community Member
    22 Posts

    Re: Titles inside CMS tabs Link to this post

    Hi Ben,

    Could you give a brief example or reference for this?

    thanks,
    Artyom

  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Re: Titles inside CMS tabs Link to this post

    Artyom,

    Here is an example of how I used this. I wanted to create a new field for video, that allows the user to upload and play video using a custom plugin I developed. The user should provide the CMS with a file, and a name for that video, and I wanted a title to point out the below fields relate to videos.

    function getCMSFields(){
    $fields = parent::getCMSFields();
    $fields->addFieldToTab("Root.Content.Main", new HeaderField("Video Upload","2")); //this is my header level two
    $fields->addFieldToTab("Root.Content.Main", new TextField("VideoTitle", "Video Title"));
    $fields->addFieldToTab("Root.Content.Main", new FileIFrameField("VideoUpload", "Upload Your Video"));
    return $fields;   
    }

    Hope that helps!

  • Artyom
    Avatar
    Community Member
    22 Posts

    Re: Titles inside CMS tabs Link to this post

    Interesting. I'll try that.

    thx, Dan

    (Moderator, is there a how-to on this? If not, there should be.)

  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Re: Titles inside CMS tabs Link to this post

    It is somewhat explained in the Wiki: http://doc.silverstripe.org/doku.php?id=headerfield

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