Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Multi Column layouts

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

Page: 1 2
Go to End
Author Topic: 4631 Views
  • ajshort
    Avatar
    Community Member
    244 Posts

    Re: Multi Column layouts Link to this post

    Your getCMSFields() method needs to be INSIDE your Page class - not outside the braces as you currently have it

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Multi Column layouts Link to this post

    jfusco - This tread expalins how to seperate a dynamic list into two colums: http://www.silverstripe.org/data-model-questions/show/252268

    DudhaSource- As ajshort said you need to keep you getCMSFields() function inside the {} of your Page class as this function is part of the 'model' (i.e. your Page class) which makes up your page. I would recommend going through the turorials to get an idea of how it all works. Also make sure your file is called Page.php not Page.css.

  • BuddhaSource
    Avatar
    Community Member
    57 Posts

    Re: Multi Column layouts Link to this post

    Thanks guys,

    After some intense work I was finally able to get things to work. But still I m not sure why it din't work before and yes I did consider getCMSFields() function inside the {} . I reinstalled everything from scratch and copied my code and it worked.

    I am still referring back to tutorials to get hang of it.

  • Antti
    Avatar
    Community Member
    6 Posts

    Re: Multi Column layouts Link to this post

    Hi!
    Im very noob with silverstripe and currently trying to learn it. Could someone please help me

    Realy cant understand why this dosnt work for me. Im getting Database error from sapphire\core\model\MySQLDatabase.php line 401. Table 'ss_firstsite.page' doesn't exist. And it dosnt exist.

    This comes after ?flush=1

    Here is mysite/code/Page.php

    class Page extends SiteTree {
       
       public static $db = array(   
          'ColumnOne' => 'HTMLText',
          'ColumnTwo' => 'HTMLText'
       );
       
       public static $has_one = array(
       );
       
       function getCMSFields() {
          $fields = parent::getCMSFields();
          $fields->addFieldToTab("Root.Content.ColumnOne", new HTMLEditorField('ColumnOne','Column One Content'));
          $fields->addFieldToTab("Root.Content.ColumnTwo", new HTMLEditorField('ColumnTwo','Column Two Content'));
          return $fields;
       }
    }

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Multi Column layouts Link to this post

    Antti - have you rebuilt the database by going to yoursite.com/dev/build?

  • Antti
    Avatar
    Community Member
    6 Posts

    Re: Multi Column layouts Link to this post

    Thank you willr.

    Dont know how i missed that. I realy should consentrate more while reading...

    4631 Views
Page: 1 2
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.