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.

Customising the CMS /

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

Content Block Order?


Go to End


1709 Views

Avatar
shakingpaper

Community Member, 15 Posts

15 June 2009 at 3:19pm

Hi there,

I have set up a page type with multiple content blocks using the below code:

<?php

class MultiPage extends Page {
   
   static $db = array(
'RowLeft' => 'HTMLText',
'RowRight' => 'HTMLText',
'RowRightTwo' => 'HTMLText'
);
   
   static $has_one = array(
   );
   
      /**
   * Additional Content Blocks
   */
   function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('RowLeft'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('RowRight'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('RowRightTwo'), 'Content');

return $fields;
}
   
}

class MultiPage_Controller extends Page_Controller {
   
}

?>

It works great but I am wondering if there is a way to control the order of how the blocks show up in the page editor. The default 'Content' area gets pushed to the bottom and I would like it to show up in the order it is shown on the page (the additional blocks show up underneath the default content area)

I hope this makes sense - any help would be much appreciated