Page listing keyword


(Clementoke) #1

Hi all,

I'm trying to hide links in the %page_list%. For example if I'm on the first page of an asset listing how do I hide the previous link?

I'm using Bootstrap so I get odd looking navigation.

  pill.JPG (1.14 KB)


(Bart Banda) #2

There should be an option on the details page of the asset listing called "Hide Unlinked Navigational Text", set this to "Yes" and it should do what you are after. 

 

If not, you can manually do it with some classes and keyword modifiers such as:

<p class="total-pages-%total_pages%">
    <a href="%previous_page_href%" class="%previous_page_href^notempty: ^empty:hidden%">Previous</a>
    %page_list%
    <a href="%next_page_href%" class="%next_page_href^notempty: ^empty:hidden%">Next</a>
</p>

The "total-pages-%total_pages%" class can be used to hide the whole pagination element if there is only 1 page worth of results. 


(Clementoke) #3

Thanks, looks like it's working but I'm getting some extra stuff appearing. My version doesn't have the option to hide unlinked navs

I've attached a snippet.

    %previous_page%%page_list%%next_page%

The next and previous links look like this

    %previous_page%%page_list%%next_page%

Can't figure how to upload an image again.


(Bart Banda) #4

Not sure what you mean by extra stuff appearing? Is there some extra HTML markup that is getting printed?