Change default Per Page in a Multi Record section

5 posts by 3 authors in: Forums > CMS Builder
Last Post: November 4, 2010   (RSS)

Re: [kblm] Change default Per Page in a Multi Record section

By Jason - November 2, 2010

Hi Kevin,

Yes there is a way to do this, it just requires changing CMS Builder code a little.
If you just want to change the default value, go into
cmsAdmin/lib/menus/default/list_functions.php

Part way down the page you'll see this code:
// load records
list($records, $metaData) = getRecords(array(
'tableName' => $tableName,
'perPage' => $isRelatedRecords ? $perPage : getFirstDefinedValue( @$_REQUEST['perPage'], 25),
'pageNum' => $isRelatedRecords ? 1 : @$_REQUEST['page'],
'orderBy' => $orderBy,
'where' => $searchWhere,

'allowSearch' => $isRelatedRecords ? false : true,
'requireSearchSuffix' => 'true',

'ignoreHidden' => true,
'ignorePublishDate' => true,
'ignoreRemoveDate' => true,
'includeDisabledAccounts' => true,

'loadPseudoFields' => false,


You can change the number highlighted in blue to whatever value you want provided it's in the drop down list already.

If you want to change the values in the drop down list go to
cmsAdmin/lib/menus/default/list.php
and find this line of code:
<?php echo getSelectOptions($metaData['perPage'], array(5, 10, 25, 50, 100, 250, 1000)); ?>

You can add values to this list to add them to the drop down box.

Once you're done this, log out and log back into CMS Builder, you should see you changes.

NOTE: if you upgrade CMS Builder, these changes will be overwritten.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Change default Per Page in a Multi Record section

By weblm - November 2, 2010

Jason,

Worked perfectly....thanks!

-Kevin
LM

Re: [Jason] Change default Per Page in a Multi Record section

By aev - November 4, 2010

Hi Jason,

how can we do the same for Category Sections?


-aev-

Re: [aev] Change default Per Page in a Multi Record section

By Jason - November 4, 2010

Hi aev,

The steps above will work for all list pages, including the category ones.

Give it a try and let me know if you run into any issues.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/