Asset Listing - Pager/Pagination


(Pawel Masloch) #1

Hi,

 

Looking for a bit of guidance on how to go about setting up pager (next || previous) function in matrix.

 

I have one of our asset listing pages up and running using the pager keywords (%next_page_href%/  || %previous_page_href% ) which in result prints "linked" &'aquo; on the page. However, the links don't point to the next/previous page as expected. In a nut shell, whether I use group formats or standard listing with children pages set up under a Group Folder or Standard Page (as a parent category)  I can actually get matrix to print the list or count correct number of siblings but unlucky to get them populated as relevant href and/or linked asset name.

 

So, before I jump off the boat and move on to jQuery plugin to get it done, I wonder if anyone can share detailed instructions on how to create a pager (alt. pagination) after the multiple pages has been deprecated? Just to clarify our cms version is 5.1.9 .

 

Many thanks - cheers!

 


(Anthony Ponomarenko) #2

Hi GBC and welcome to the forums,

 

Try using the following:

 

%previous_page% %next_page%

 

The keywords you are currently using are the actual URL links, not the anchors as the above keywords are.

 

You can also customise the text that is shown in these anchors on the details page of the Asset Listing


(Pawel Masloch) #3

Hi Anthony,

 

Thanks for getting back on the topic.

 

Unfortunately, that is not the case. The following piece of script is currently in use on Type/Group Format:

<li><a href="%previous_page_href%" class="%previous_page_href^notempty: ^empty:hidden%">%previous_page% &laquo;</a></li> <li><a href="%next_page_href%" >%next_page% &raquo;</a></li>

...and that actually prints only &'aquo; linked to current asset. So, although I can count/print the items in the list (using e.g. %asset_name_listing%, %group_listing%...) they are not being pulled for previous/next pager on this occasion.

 

Since it is rather long story, I'll try to keep it short and sweet. Imagine this situation:

 

Site;

 Index

  Category#1 [Standard Page;]

    Sub-Cat [Standard Page or Folder]

      Content Page[Standard Page as child asset]

      Content Page[Standard Page as child asset]

      Content Page[Standard Page as child asset]

      Content Page[Standard Page as child asset]

      [etc..]

    Sub-Cat [Standard Page or Folder]

    Sub-Cat [Standard Page or Folder]

    Sub-Cat [Standard Page or Folder]

    [etc...]

  Category#2 - Parent Asset;

  Category#3 - Parent Asset;

  [etc...]

 

The task on hand is to create a pager that allows back and forth navigation for Sub-Cat's children pages. As a part of the design and users' journey we list all topics (Content Pages) on Sub Cat as well as Content pages - this is achieved by basic asset listing and <ol> markup followed by related content. However, when on Content Page we are also looking to allow next/previous page linking in between all asset grouped under that Parent Asset [Sub Cat], which currently seems to be an issue.

As mentioned in my opening the system counts asset in the list fine and displays correct results if I use any other keywords e.g. %group_name_linked% => Sub-Cat...

So, it's clear that the pager list set up doesn't seem to be able to pick up the siblings group, hence the configuration must be flowed somewhere - the question is where? Also, what would be preferred way of creating a pager and/or pagination in matrix? I'd appreciate a nice guide...

 

Hope this explains in greater detail where we are at.

 

I am happy to share more should you need to.

 

Cheers.


(Anthony Ponomarenko) #4

You could set up a nested asset listing to view the Content Pages using a dynamic root node and set the number of assets per page as 1.

Then add the next and previous to the Page Contents.


(Pawel Masloch) #5

Hello Anthony,

 

I'd be very keen to read your instructions in more detail, if possible? Lets say a generic break down of how would you achieve a pager as the final result - expanding on your last post, please. Something that give us a better idea...

Can you make sure you let us know if you actually choose to nest the list in the design customization, paint layout or on the standard page alone? And also, when nesting the asset listing in another asset listing which dynamic parameters and source would you use and where exactly, e.g. 'list_current_asset_id goes on child asset listing page'? Please, try to be clear on your guidelines...

 

..I ask of all this as I have spent a couple of days trying to get to the bottom of whether it is actually possible or not to get the pager/pagination working using available tools in matrix (and not necessary search page). Having said that, there are countless asset listing pages We have already implemented successfully but this one. If it helps, very similar feature has been set up on squiz's manuals site using search page - I guess...

 

Thanks.


(Pawel Masloch) #6

Hi,

 

Please note I have managed to solve this using asset listing and literally 3 lines of jQuery.

 

Having said that, I would be happy to hear if/when pager feature becomes available as a native setting in Matrix.

 

Cheers.


(Anthony Ponomarenko) #7

Pagination is build into Listing assets by default, and in Matrix 5.2 and above the next and previous page keywords were added.

 

Re-reading your initial post as you are on 5.1.9 unfortunately these keywords are not available.

 

If you are a Squiz client you can get an upgrade to the latest version, currently 5.2.7.6, by contacting your Account Manager.