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.

Customising the CMS /

Multi Column layouts


Go to End
Reply


14 Posts   4777 Views

Avatar
ajshort

Community Member, 244 Posts

23 January 2009 at 8:36pm

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

Avatar
Carbon Crayon

Community Member, 598 Posts

23 January 2009 at 10:40pm

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.

Avatar
BuddhaSource

Community Member, 57 Posts

24 January 2009 at 1:54am

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.

:)

Avatar
Antti

Community Member, 6 Posts

20 October 2009 at 5:35am

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;
   }
}

Avatar
Willr

Forum Moderator, 5513 Posts

20 October 2009 at 9:07am

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

Avatar
Antti

Community Member, 6 Posts

30 October 2009 at 4:09am

Thank you willr.

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

Go to Top