Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / $this_is_home_page <div> image containger </div> causes white space on other pages?

$this_is_home_page <div> image containger </div> causes white space on other pages?

Started by limelites on 28 Feb 2014, 8:38 AM · Views: 1,802

Results 1 to 6 of 6
28 Feb 2014, 8:38 AM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #1 by limelites

Using the code from the page, here:

http://www.zen-cart.com/content.php?251-i-want-to-display-some-of-my-sideboxes-on-my-front-page-only-and-suppress-them-from-all-other-pages

I've transalted it this in tpl_footer.php:

<?php if($this_is_home_page) { ?>

<div id="HPFooterBadges" >

<!--HTML IMAGES CONTAINER-->

HTML CONTENT HERE

<!--HTML IMAGES CONTAINER-->

</div>

<?php } ?>

Works in so far as the content is displayed only on the home page but on the other site pages it's created an empty row of white space where the images are on the home page. All it's doing is hiding the images, not the <div></div>

Anyone know how to hide the div?

28 Feb 2014, 9:48 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #2 by gilby

limelites:

Using the code from the page, here:

http://www.zen-cart.com/content.php?251-i-want-to-display-some-of-my-sideboxes-on-my-front-page-only-and-suppress-them-from-all-other-pages

I've transalted it this in tpl_footer.php:

<?php if($this_is_home_page) { ?> <div id="HPFooterBadges" > <!--HTML IMAGES CONTAINER-->

HTML CONTENT HERE

<!--HTML IMAGES CONTAINER--> </div> <?php } ?>
> 
> 
> Works in so far as the content is displayed only on the home page but on the other site pages it's created an empty row of white space where the images are on the home page.  All it's doing is hiding the images, not the <div></div>
> 
> Anyone know how to hide the div?Something else is going on here.?
I use exactly the same code in my footer and it works fine as it should.
No divs are present on other pages.
Got a link?
28 Feb 2014, 10:02 AM
#3
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #3 by limelites

gilby:

Something else is going on here.?
I use exactly the same code in my footer and it works fine as it should.
No divs are present on other pages.
Got a link?

Whoops, sorry it's https://www.silkblooms.co.uk

28 Feb 2014, 10:54 AM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #4 by limelites

You don't see any div's when you inspect the other pages but the white space under the footer wasn't there before I added this div on the home page

28 Feb 2014, 11:07 AM
#5
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #5 by gilby

limelites:

You don't see any div's when you inspect the other pages but the white space under the footer wasn't there before I added this div on the home pageYes this is working exactly as it should.

On long pages you have a "Scroll to Top" feature at the bottom of the page. This takes up some space.
On short pages this doesn't show but the space is still there.
This "feature" takes up the same amount of space whether it shows or not.
I suspect this needs further investigation!

28 Feb 2014, 11:30 AM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #6 by limelites

Ahhh, so that's the culprit! Thanks Gilby, I'll set a min-height:0; on the scroll to top feature. Hopefully that'll solve it.