Jump to content

Pagination with Url Segments


jds43
 Share

Recommended Posts

Hello,

I'm trying to paginate results that may have Url Segments and I want to modify the Base Url. How do I accomplish this within renderPager? I found docs here: https://processwire.com/api/ref/markup-pager-nav/render/, but it hasn't pointed me in the right direction. 

$pager->setBaseUrl(string $url);

    echo "<div id='pagination' class='uk-container uk-container-medium uk-margin-large-top'>";
        	echo $matches->renderPager(array(
    		    'nextItemLabel' => "Next",
    			'previousItemLabel' => "Prev",
                'currrentItemClass' => "uk-active",								    
    		    'listMarkup' => "<ul class='row uk-flex-right'>{out}</ul>",
    		    'itemMarkup' => "<li class='{class}'>{out}</li>",
    		    'linkMarkup' => "<a href='{url}' class='uk-button uk-background-secondary'><span class=''>{out}</span></a>",
    		));
    echo "</div>";

Or, does anyone know of a better option?

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

×
×
  • Create New...