opalepatrick Posted July 7, 2014 Posted July 7, 2014 I am using MarkupPagerNav pretty much as per the examples with this being the code. The strange thing is that the $pagination at the top does not work but the one after the product loop does. Two identical bits of code. Any ideas? $selector = "template=fabric,collection=" . $type; $products = $pages->find("$selector, start=0, limit=12, sort=title"); $pagination = $products->renderPager(array( 'nextItemLabel' => "Next", 'previousItemLabel' => "Prev", 'listMarkup' => "<ul class='MarkupPagerNav pagination'>{out}</ul>", 'currentItemClass' => "current", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>" )); ?> <div class="row mainrow firstrow lastrow"> <div class="pagination-centered"> <?=$pagination?> </div> <?php foreach($products AS $product) { ?> <div class="small-6 medium-3 large-3 columns" itemscope itemtype="http://schema.org/Product"> <a href="<?= $product->url ?>"><img src="<?= $product->images->first()->url ?>" itemprop="image"></a> <div class="prod_panel panel"> <h5 itemprop="name"><?= $product->title ?></h5> </div> </div> <?php } ?> <div class="clearer"> </div> <div class="pagination-centered"> <?=$pagination?> </div> </div>
yellowled Posted July 7, 2014 Posted July 7, 2014 Well, it's kind of hard to tell why it doesn't work without knowing what doesn't work. Does it not create any HTML markup? Can you not click the pagination links (that might be a CSS issue rather than a PHP issue)? Do you have an accessible live example that we could check?
opalepatrick Posted July 7, 2014 Author Posted July 7, 2014 Good point yellowled. Basically on inspection, it spits out identical code. I have pasted them so that I could see if there were any differences. Just that the bottom one functions as you would expect and the top one does not. I wonder if it something to do with the css framework, cos thinking about it, the elements dont respond in the same way on hover, etc. and that should have nothing to do with the code as such. The bottom one acts like it links on hover for instance I can see the url, but the top does not, even though, as I say, the html is identical.
yellowled Posted July 7, 2014 Posted July 7, 2014 If you look for CSS “regressions”, my first thing to check out would be if all floats are cleared properly, if there's any “strange” positioning involved. Maybe to test it, temporarily deactivate CSS altogether or very selectively for the pagination using the browser's dev tools. If the pagination links are there and the markups looks the same, it's very likely some CSS issue. 2
LostKobrakai Posted July 8, 2014 Posted July 8, 2014 I don't know if you used js somewhere on the page. It could be a to greedy click-handler with preventDefaults(), which affects the top part in some way.
opalepatrick Posted July 8, 2014 Author Posted July 8, 2014 OK, still investigating but the top being different to bottom thing is a non-issue... it was caused by a hidden div with a higher z-index. So now I am back to the fact that regardless, the resultset is always the first page. I have re-installed and I am still getting the same behaviour. So, the links look OK, but when /collection/avanti/page2 comes up, the first page is reloaded. It is as if the variable that is storing the current resultset is not being set and therefore it just reverts to zero.
opalepatrick Posted July 8, 2014 Author Posted July 8, 2014 As soon as I edited that last entry I realised that when I was messing around earlier trying to sort this, I added start=0, to the $page->find selection. So, of course it was returning to 0 every time! Thanks to you all for putting up with my meanderings
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now