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.

Showcase Questions

Feedback and questions about sites in the Community Showcase.

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

How to make 2 column page?


Reply

4 Posts   2598 Views

Avatar
lakum4SS

3 October 2009 at 8:35pm Community Member, 2 Posts

I am new to use SilverStripe. I want to make 2 column layout of a page. Help me to make it.

Avatar
Juanitou

3 October 2009 at 8:52pm (Last edited: 4 October 2009 12:46am), Community Member, 323 Posts

Sure! Do you want some coffee too?

Avatar
premiumface

17 October 2009 at 12:25pm Community Member, 1 Post

:) funny

Avatar
Samba Sam

8 December 2009 at 9:15am (Last edited: 8 December 2009 9:17am), Community Member, 85 Posts

Hi,
Did you ever get an answer to your question? You might get a better response if you were more specific about what you need help with as well as posted it in more relevant forum section (e.g., "Template Questions".)

Have you completed the tutorials at http://doc.silverstripe.org/doku.php?id=tutorials? That will get you pointed in the right direction.

If you wanted to make an editable sidebar with an image and content, you could do something like the following in your Page.php.

<?php
class Page extends SiteTree {
static $db = array(
'SidebarImageCaption' => 'Varchar(50)',
'SidebarContent' => 'HTMLText',
);

static $has_one = array(
'SidebarImage' => 'Image');

function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Sidebar", new ImageField("SidebarImage", "Image"));
$fields->addFieldToTab("Root.Content.Sidebar", new TextField("SidebarImageCaption", "Caption"));
$fields->addFieldToTab("Root.Content.Sidebar", new HtmlEditorField("SidebarContent", "Content"));
return $fields;
}
}

class Page_Controller extends ContentController {
....

}
?>

This will create a "Sidebar" tab in the CMS admin that you can add an image and text to.
Hope this gets you started,
Sam