Jump to:

23487 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Multiple column content areas

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1964 Views
  • redactuk
    Avatar
    Community Member
    117 Posts

    Multiple column content areas Link to this post

    I've been using SS for a month now and I'm getting the hang of it. On one site I've just finished I've created a sidebar for lower level pages to effectively create two columns, but with that in the Admin area I had 'Content' editor then editor below it for 'Sidebar'.

    Question: I want a home page with 3 columns. I can see how to create 3 new columns but what do I do with existing 'Content' section? Can I someone remove that from a custom HomePage or do I HAVE to use existing area as one of my 3 columns and change caption in Admin area from 'Content' to say 'Column 1' ?

  • b0bro
    Avatar
    Community Member
    38 Posts
  • redactuk
    Avatar
    Community Member
    117 Posts

    Re: Multiple column content areas Link to this post

    Excellent, thank you!

    but just to be clear, if I add

    // remove the content text area
    $fields->removeFieldFromTab("Root.Content.Main","Content");

    Within my HomePage.php (that extends Page), I'm just removing the visibility of Content within context of the Home page Not from all other page types?

  • b0bro
    Avatar
    Community Member
    38 Posts

    Re: Multiple column content areas Link to this post

    Yes thats right,

    It goes both ways, for example if you use, on page.php

    $fields->addFieldToTab("Root.Content", new TextField("ExtraContent", "Extra Content"));

    it would appear on everypage that extends page. For example the following page would have ExtraContent

    class ExamplePage extends Page {
    function getCMSFields() {
        $fields = parent::getCMSFields(); //This is the magic
        return $fields;
       }
    }

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