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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Showcase Questions /

Feedback and questions about sites in the Community Showcase.

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

How to make 2 column page?


Go to End


4 Posts   3896 Views

Avatar
lakum4SS

Community Member, 2 Posts

3 October 2009 at 8:35pm

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

Avatar
Juanitou

Community Member, 323 Posts

3 October 2009 at 8:52pm

Edited: 04/10/2009 12:46am

Sure! Do you want some coffee too?

Avatar
premiumface

Community Member, 1 Post

17 October 2009 at 12:25pm

:) funny

Avatar
Samba Sam

Community Member, 85 Posts

8 December 2009 at 9:15am

Edited: 08/12/2009 9:17am

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