The template portion of our page numbering previously read like this:
[-- IF PAGE.NumProducts "0" --][-- ELSE --][-- VAR.ProductType "full" --]
[-- IF PAGE.ProductsPerPage NE "0" --]<div id="bbpag1" class="bbpagination">[-- IF PAGE.PaginatedPageNumMax GT 0 --]<span>Page</span>[-- END_IF --][-- PrevNext NoCenter --]</div>[-- END_IF --]
<div id="bblpprods" class="loop[-- VAR.Cols --][-- IF PAGE.DisplayColumnBorders --] borders[-- END_IF --]"><ul id="bb-loopproducts" class="bb-loopheight">[-- VAR.Count 0 --][-- LOOP PRODUCTS --]<li class="prod bb-matchheight">[-- PRODUCT --]</li>[-- IF VAR.Count EQ VAR.MaxCount --][-- VAR.Count 0 --][-- END_IF --][-- END_LOOP PRODUCTS --]</ul><div class="clear"></div></div>
A result might look like this:
Page 1 2 3 4 Next
I typically show 18 products per page, but in addition to this I wanted to add a "View All" feature to our website. My solution (using my "Bags" page as an example) was:
1. Copy Bags page keeping all page links and assigned products. I named this new page Bags - All (filename bags-all.html).
2. On the Layout Settings of Bags - All I changed the Max # of products per page to 1,000, essentially making this a View All page for this category.
3. I created a custom Page Field 2. In this field on my original Bags page, I entered <a href="http://www.dancesupplies.com/bags-all.html">View All</a>.
I placed the [-- PAGE.Field2 --] in the template, so it now reads like this:
[-- IF PAGE.NumProducts "0" --][-- ELSE --][-- VAR.ProductType "full" --]
[-- IF PAGE.ProductsPerPage NE "0" --]<div id="bbpag1" class="bbpagination">[-- IF PAGE.PaginatedPageNumMax GT 0 --]<span>Page</span>[-- END_IF --][-- PrevNext NoCenter --][-- PAGE.Field2 --]</div>[-- END_IF --]
<div id="bblpprods" class="loop[-- VAR.Cols --][-- IF PAGE.DisplayColumnBorders --] borders[-- END_IF --]"><ul id="bb-loopproducts" class="bb-loopheight">[-- VAR.Count 0 --][-- LOOP PRODUCTS --]<li class="prod bb-matchheight">[-- PRODUCT --]</li>[-- IF VAR.Count EQ VAR.MaxCount --][-- VAR.Count 0 --][-- END_IF --][-- END_LOOP PRODUCTS --]</ul><div class="clear"></div></div>
The result is:
Page 1 2 3 4 Next View All
This works pretty well. The "View All" links to the new Bags page that lists all assigned products to it. However, I would like to improve it further:
For pages with 18 products or less, I still see this:
Page View All
Is there a way edit the code to hide the page navigation altogether when there is only one page, and have it show up only when there is more than one page?
Thanks in advance!