Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » how I can creat a new Tab?

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: 2051 Views
  • Ney
    Avatar
    Community Member
    8 Posts

    how I can creat a new Tab? Link to this post

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

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: how I can creat a new Tab? Link to this post

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

  • Ney
    Avatar
    Community Member
    8 Posts

    Re: how I can creat a new Tab? Link to this post

    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

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: how I can creat a new Tab? Link to this post

    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.

  • Ney
    Avatar
    Community Member
    8 Posts

    Re: how I can creat a new Tab? Link to this post

    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

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