Asset Listing Page with Next and Previous


(Nick Papadatos) #1

Currently being upgraded to the latest version by Wednesday:
My question is having an asset listing page that will show (some keyword modifier) next and previous asset name/titles.

Example:
< previous asset title | Next asset title >
%previous_page^as_asset:asset_name% | %next_page^as_asset:asset_name%
would that work?

Thanks in advance


(Jsinclair) #2

Hi NickyP,

The keywords you’ve quoted there probably won’t work inside an asset listing type format. But depending on what you’re trying to do, there may be another solution. If you are listing pages that are all in the same folder, you could possibly do something like:

&lt; %asset_sibling_prev^as_asset:asset_name% | %asset_sibling_next^as_asset:asset_name% &gt;

That would get you the titles. To make them links, you’d need to add a bit more HTML, but the principle is the same.

Hope that helps.


(Nick Papadatos) #3

Thanks jrsinclair - when we can jump back in after the upgrade I’ll give that a go.
I was going to have the asset listing located in a config folder outside the “articles” folder using dynamic parameters.

Note: %asset_sibling_prev% and %asset_sibling_next% was added to v5.2.0 :slight_smile:


(Nick Papadatos) #4

Now that we’re on the latest version of Matrix using the keyword/s
<a href="./?a="%asset_sibling_prev%">asset_sibling_prev^as_asset:asset_name% and
<a href="./?a="%asset_sibling_next%">asset_sibling_next^as_asset:asset_name%

My question is is there a keyword modifier that when you’re at the end of the line it does link/show the Parent’s pagecontent - similar to how an asset listing page pagination works? So if at the end hide %asset_sibling_prev% and so on.


(Bart Banda) #5

Well you could do something like checking if there even is a sibling and then printing the content right?
Something like:

%begin_asset_sibling_next%
%asset_sibling_next^as_asset:asset_name%
%end_asset%

Although if you just use something like %asset_sibling_next^as_asset:asset_name_linked% it will print empty anyways if there is no sibling.


(Nick Papadatos) #6

Great! Thanks Bart, haven’t used these keywords before so they’re going to come in handy for my next project
Regards
Nick