THE CHANGE RECORDS PER PAGE DEFAULT PLUGIN - Mar 7th, 2013


One of the new features of CMS Builder (since version 2.17) is the ability select how many records are displayed on the
list page of a section. If you go to the Section Editor section in the left hand menu, then click modify on a section
you want to edit. At the top of the modify section page should be 5 tabs, if you select the advanced tab you should see
a per page drop down that allows you to select how many records should be displayed per page.

If you want to institute a "pseudo" global approach to this issue, see the recipe called CHANGE THE DEFAULT 25 RECORDS
PER PAGE ON A RECORD LIST.

And, if you're using Version 2.51 or later, and are looking for a more global change, you can use the plugin below
offered by Dave Edis from Interactive Tools to change all of the default per page values to any value you need.

He suggests backing up all of your /data/schema/ files first and then try this:

Copy the code below to as blank document, name it perpagechanger.php, upload it to your plugins folder and activate the
plugin under Admin>plugins.



<?php


### UPDATE THESE VALUES
$GLOBALS['PERPAGECHANGER_NEWVALUE'] = 1000; //

// DON'T UPDATE ANYTHING BELOW THIS LINE

// plugin menu - add link
pluginAction_addHandlerAndLink(t('Update Sections'), 'perPageChanger', 'admins');

//
function perPageChanger() {
foreach (
getSchemaTables() as $tableName) {
$schema = loadSchema($tableName);
$schema['_perPageDefault'] = $GLOBALS['PERPAGECHANGER_NEWVALUE'];
saveSchema($tableName, $schema);
alert("Updated '$tableName' to have a per page default value of {$GLOBALS['PERPAGECHANGER_NEWVALUE']}\n");
}
}

?>



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service