List Item per page multiple on 6

Status
Not open for further replies.
You would probably have to take the same approach as Rob outlined in that post you referenced, but instead of hard coding the select input, copy the code from the getLimitBox() function you looked at in pagination.php, and echo $html rather than returning it. That way the code handles remembering the currently selected limit and setting it as the selected option.

PHP:
<?php
/**
* Layout: List Pagination Footer
*
* @package     Joomla
* @subpackage  Fabrik
* @copyright   Copyright (C) 2005-2014 fabrikar.com - All rights reserved.
* @license     GNU/GPL http://www.gnu.org/copyleft/gpl.html
* @since       3.3.3
*/

$d = $displayData;
?>
<div class="list-footer">
    <div class="limit">
        <div class="input-prepend input-append">
            <span class="add-on">
                <label for="<?php echo $d->listName;?>">
                    <small>
                    <?php echo $d->label; ?>
                    </small>
                </label>
            </span>

<?php
        // Initialize variables
        $limits = array();
        $values = array();

        for ($i = 3; $i <= 18; $i += 3)
        {
            $values[] = $i;
        }

        $values[] = 30;
        $values[] = 90;

        if (!in_array($this->startLimit, $values))
        {
            $values[] = $this->startLimit;
        }

        asort($values);

        foreach ($values as $v)
        {
            $limits[] = JHTML::_('select.option', $v);
        }

        if ($this->showAllOption == true)
        {
            $limits[] = JHTML::_('select.option', '-1', FText::_('COM_FABRIK_ALL'));
        }

        $selected   = $this->viewAll ? '-1' : $this->limit;
        $js         = '';
        $attributes = 'class="inputbox input-mini" size="1" onchange="' . $js . '"';
        echo JHTML::_('select.genericlist', $limits, 'limit' . $this->id, $attributes, 'value', 'text', $selected);
?>
            <span class="add-on">
                <small>
                    <?php echo $d->pagesCounter; ?>
                </small>
            </span>
        </div>
    </div>
    <?php echo $d->links; ?>
    <input type="hidden" name="limitstart<?php echo $d->id; ?>" id="limitstart<?php echo $d->id; ?>" value="<?php echo $d->value; ?>" />
</div>
 
And in this commit, I tweaked the pagination class so you can put the overrides in list templates, like ...

./components/com_fabrik/views/list/tmpl/your_template/layouts/pagination/fabrik-pagination-limitbox.php

So copy the default ./components/com_fabrik/layouts/pagination/fabrik-pagination-limitbox.php to a list template location, and tweak it as per the stuff in my earlier post.

https://github.com/Fabrik/fabrik/commit/17bd9326889c703f79d197ad9888856bb912e36c

-- hugh
 
Thank You for your help and developing.
Another useful option in continually growth of Fabrik a very flexible tool.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top