7935 Posts in 1536 Topics by 943 members
|Go to End|
16 September 2011 at 9:22pm
I have ImageDataObjectManager, with images, all working nice.
But DOM displays 10 objects per page in CMS as default, how do I change this particular ImageDOM to display all items per page as default?
16 September 2011 at 10:34pm
Just set $yourManager->setPageSize( '999' );
17 September 2011 at 2:18am
1 November 2011 at 2:55pm Last edited: 1 November 2011 2:57pm
hmmm... not sure if that works (does it uncle?) didnt seem to for me.. although I noticed the code is there in the DOM.php
I managed to do the same using code below.. not sure if correct way.
27 April 2012 at 6:18pm
Here's a more complete solution.
// Show All by default
$manager->per_page = "9999";
Be sure to replace RelationName with the actual name of the relation in question.
Only using setPageSize (line 3) means the drop down no longer works, so after setting it to default you set it based on the request value (line 4). Setting per_page (line 1) is necessary for the dropdown to have All selected in the dropdown by default. It is necessary to make a small hack of changing the decleration of per_page from protected to public in DataObjectManager.php for this last bit to work. Everything else works fine without the hack.
|Go to Top|