I am new to use SilverStripe. I want to make 2 column layout of a page. Help me to make it.
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.
Sure! Do you want some coffee too?
:) funny
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