17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1739 Views |
-
Two columns

30 May 2007 at 11:03pm Last edited: 30 May 2007 11:03pm
Hi
I've just started experimenting with Silverstripe, and so far I'm very pleased with it.
I just found the need to have two columns in some pages, and would like to be able to edit the "left" and "right" content just as with any regular (single-column) page content.What's the best way to do this?
Thanks in advance
/Jonas -
Re: Two columns

31 May 2007 at 5:20pm
Silverstripe doesn't limit you in this, just put in your content as pleased (e.g. $TagCloud in <div id="Sidebar">, and $Content in <div id="Content">). Use CSS to render those two divs as columns.
see http://www.positioniseverything.net/articles/pie-maker/pagemaker_form.php
for a good css-layout-creator. -
Re: Two columns

31 May 2007 at 9:47pm Last edited: 31 May 2007 9:49pm
You'll want to create new HtmlEditorField(s), which are the same as the standard Content field.
Page.php
<?php
class Page extends SiteTree {
static $db = array(
'RightContent' => 'Text'
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Right', new HtmlEditorField('', 'Right Content'));
return $fields;
}}
Page.ss
<div id="RightContent">
$RightContent
</div>Note that I've added this HtmlEditorField into it's own tab. It's easier to use like this, since it's so large compared to say, a text field.
Cheers,
Sean
| 1739 Views | ||
|
Page:
1
|
Go to Top |



