Jump to content

how to make the current page link just text (not a link) in pagination?


gtoirog
 Share

Recommended Posts

Hi gtoirog,

from this page ( http://processwire.com/api/modules/markup-pager-nav/ ) you can see all the custom options connected to the Pagination in PW.

The one you are looking for is "currentItemClass" that determines the css class for the current/active/on button list item.

From the documentation :

<?php
echo $results->renderPager(array(
    'currrentItemClass' => "active" // "active" is just the class name I choose.
));  

From there, in your css you could style it however you want.

Since css, by now, hasn't a common solution to disable a link yet, you should disable it via Jquery.

Something like this might work as expected :

$('.active').attr('disabled', true);

Give it a try :)

  • Like 1
Link to comment
Share on other sites

You don't even have to do the first step that 3fingers referred. Knowing that the default class is "MarkupPagerNavOn" you could simply:

$('.MarkupPagerNavOn').attr('disabled', true);

or even simply replace all the content of that element (the link) by only the number:

$('.MarkupPagerNavOn').each(function(){
    $this = $(this);
    $this.html($this.children('a').text());
});
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...