Forums / Templates, Stylesheets, Page Layout / Hiding the div for page numbers when one 1 page exists

Hiding the div for page numbers when one 1 page exists

Locked

Views: 933

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
19 Sep 2008, 9:06 PM
#1
dsided avatar

dsided

Zen Follower

Join Date:
Jun 2008
Posts:
128
Plugin Contributions:
0

Hiding the div for page numbers when one 1 page exists

I've added a div with a padding to the page numbers which appear at the top and bottom of the product listings page.

This causes a problem when there are only enought products to show one page as the div is still there with it's padding. This pushes everything down the page.

Does you know if there is a piece of conditional code to only display the content if there is <1 pages?

<?php if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<div id="productsListingListingTopLinks"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>

<?php
}
?>

John Crumpton, Technical Director of Double Sided
Zen cart shop: Buy happie loves it

21 Sep 2008, 12:13 AM
#2
dsided avatar

dsided

Zen Follower

Join Date:
Jun 2008
Posts:
128
Plugin Contributions:
0

Re: Hiding the div for page numbers when one 1 page exists

The solution is quite easy! Just needed to increase the number_of_rows value to the number of products you're showing on the product listing page. In my case I'm using the categories mod with 4 items per row with a max of 12 items.

  <?php if ( ($listing_split->number_of_rows > 12) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<div id="productsListingListingTopLinks"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>


<?php
}
?> 

John Crumpton, Technical Director of Double Sided
Zen cart shop: Buy happie loves it

21 Sep 2008, 6:26 PM
#3
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Hiding the div for page numbers when one 1 page exists

Thanks for sharing your solution for other forum visitors.

Steve