21473 Posts in 5780 Topics by 2620 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1685 Views |
-
Multiple column content areas

30 September 2009 at 11:31am Last edited: 30 September 2009 11:33am
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' ?
-
Re: Multiple column content areas

30 September 2009 at 12:08pm
Hi dude, have a look at this http://doc.silverstripe.org/doku.php?id=getcmsfields&s=remove%20field
-
Re: Multiple column content areas

30 September 2009 at 12:26pm Last edited: 30 September 2009 12:27pm
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?
-
Re: Multiple column content areas

30 September 2009 at 8:27pm Last edited: 30 September 2009 8:28pm
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;
}
}
| 1685 Views | ||
|
Page:
1
|
Go to Top |


