Jump to:

130 Posts in 947 Topics by 55 members

Showcase Questions

SilverStripe Forums » Showcase Questions » How to make 2 column page?

Feedback and questions about sites in the Community Showcase.

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

Page: 1
Go to End
Author Topic: 2586 Views
  • lakum4SS
    Avatar
    Community Member
    2 Posts

    How to make 2 column page? Link to this post

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

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: How to make 2 column page? Link to this post

    Sure! Do you want some coffee too?

  • premiumface
    Avatar
    Community Member
    1 Post

    Re: How to make 2 column page? Link to this post

    funny

  • Samba Sam
    Avatar
    Community Member
    85 Posts

    Re: How to make 2 column page? Link to this post

    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

    2586 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.