Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Titles inside CMS tabs


Go to End


6 Posts   1926 Views

Avatar
DanStephenson

Community Member, 116 Posts

23 April 2009 at 10:27am

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?

Avatar
Ben Gribaudo

Community Member, 181 Posts

24 April 2009 at 12:12am

Hi Dan,

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

Ben

Avatar
Artyom

Community Member, 22 Posts

25 April 2009 at 11:09am

Hi Ben,

Could you give a brief example or reference for this?

thanks,
Artyom

Avatar
DanStephenson

Community Member, 116 Posts

25 April 2009 at 11:27am

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!

Avatar
Artyom

Community Member, 22 Posts

25 April 2009 at 11:32am

Interesting. I'll try that.

thx, Dan

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

Avatar
DanStephenson

Community Member, 116 Posts

25 April 2009 at 11:36am

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