Multiple page lists pagination
Permalink
I have been searching around the forums for similar issues but have as yet been unsuccessful. I have created a page (http://www.englishwineproducers.com/vineyards/vineyard-search/... ) which contains two page lists embedded within the template using:
and
The first page list returns the results of a search in the main column and I have used the second page list to generate a dropdown list for search filter parameters in the sidebar.
Both lists are displaying as expected when the page first loads however when clicking on the pagination links the dropdown list is no longer populated.
Would I be correct in assuming this is down to the querystring ?ccm_paging_p=X trying to load an empty list of pages as the second page list is set to display all? If so, is there a way to switch off pagination when hard coding a page list - something along the lines of
[code]
$pl->paginate(false);
[/page]
If it is not down to pagination then how would I go about isolating the issue?
I would be grateful if anyone has any pointers or suggestions with this issue.
Thanks
Paul
Loader::model('page_list'); $pl = new PageList();
and
Loader::model('page_list'); $pl2 = new PageList();
The first page list returns the results of a search in the main column and I have used the second page list to generate a dropdown list for search filter parameters in the sidebar.
Both lists are displaying as expected when the page first loads however when clicking on the pagination links the dropdown list is no longer populated.
Would I be correct in assuming this is down to the querystring ?ccm_paging_p=X trying to load an empty list of pages as the second page list is set to display all? If so, is there a way to switch off pagination when hard coding a page list - something along the lines of
[code]
$pl->paginate(false);
[/page]
If it is not down to pagination then how would I go about isolating the issue?
I would be grateful if anyone has any pointers or suggestions with this issue.
Thanks
Paul
Thank you for your swift response.
I have tried a few variations of this based on the cheatsheet but there seems to be a difference between embedding the page list:
and initiating a page list as I have been:
There seems to be some correlation between controller functions in the two methods e.g.
and
which was why I was wondering if there was an equivalent to your suggested
I have tried your suggested method and also my guess at the equivalent
but with no success.
I may need to look into altering the way the page list is embedded in the template in order to get it to work.
Thanks
Paul
I have tried a few variations of this based on the cheatsheet but there seems to be a difference between embedding the page list:
$bt = BlockType::getByHandle('page_list'); //Set Options $bt->controller->...
and initiating a page list as I have been:
Loader::model('page_list'); $pl = new PageList();
There seems to be some correlation between controller functions in the two methods e.g.
$bt->controller->cParentID = '1';
and
$pl->filterByParentID($cParentID);
which was why I was wondering if there was an equivalent to your suggested
$bt->controller->paginate = 'false';
I have tried your suggested method and also my guess at the equivalent
$pl->paginate(false);
but with no success.
I may need to look into altering the way the page list is embedded in the template in order to get it to work.
Thanks
Paul
What about:
$pages = $pl->get($itemsToGet = 100, $offset = 0)
Thank you so much - I have just implemented it and it works a treat!
http://www.englishwineproducers.com/vineyards/vineyard-search/?ccm_...
Does the offset variable cause the pagination to be ignored altogether?
Thanks for all your help.
Paul
http://www.englishwineproducers.com/vineyards/vineyard-search/?ccm_...
Does the offset variable cause the pagination to be ignored altogether?
Thanks for all your help.
Paul
In the embed page list block in theme section, it indicates the ability to turn pagination off.