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.

Archive /

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

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

how I can creat a new Tab?


Reply


5 Posts   2156 Views

Avatar
Ney

Community Member, 8 Posts

27 March 2008 at 5:39am

hello frd, I'm trying to create a new Tab in Product but I don't find the wat, could u show me how I can do it? thank u!!!

Avatar
Liam

Community Member, 470 Posts

27 March 2008 at 5:49am

Read the tutorials for extending a basic site

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

You add something like this to your class, directly taken from the tutorial:

function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');
   
return $fields;
}

Avatar
Ney

Community Member, 8 Posts

27 March 2008 at 8:05am

hello Lee for u quick answer but it is ok when I want to add field to a tab already existent, but I want to create new tab!!! if u know how I can do it I will be grateful thank u

Avatar
Liam

Community Member, 470 Posts

27 March 2008 at 8:30am

The line in the above code Root.Content.Main refers to your site structure.

Root is the start/top level, Content refers to the content tab, and main is the main tab. Just change the name to a new tab and it will make it for you.

Avatar
Ney

Community Member, 8 Posts

28 March 2008 at 10:29pm

hello Lee, thank u!!!! it works!!!! now I have another task and I don't know how to start:
I'm using SilverStrip CMS and I want to move the ecommerce module in the top menu and to remove it of site content (the products)!!!! I'm newbie and need a guide how to do it, thank for ur help