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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

SortOrder increment before addFieldToTab


2 Posts   519 Views


26 October 2011 at 12:47am (Last edited: 26 October 2011 12:52am), Community Member, 15 Posts

I can get SortOrder Value in Admin Backend with SortOrder in DataObjectManager array like this:

$f->addFieldToTab("Root.Content.Mysite", new DataObjectManager(




         array('Thumb' => 'Thumb','Name' => 'Name','Url' => 'Url','Category'=>'Category','Languages'=>'Languages','Countries' => 'Countries','SortOrder' => 'SortOrder'),



I have no idea how to increment the value in this Page Model. How can i access SortOrder before addFieldToTab?


27 October 2011 at 2:03am Community Member, 15 Posts

I added a function to the corresponding Data Object.

Like described in datamodel [url][/url] i have overwritten the getSortOder funct.

function getSortOrder() {

// SortOrder is not working
//return $this->SortOrder;


But i can not access the field SortOrder. With Name, like in the code it works.

i thought it could be perhaps


but don't work.

I have not defined SortOrder, this field is from Dataobjectmodel auto generated per _config.php


In Admin Backend first element shows nothing because SortOrder=0. That's why i like to override getSortOrder with - something like -

return ($this-SortOrder+1);