SimpleAds Block template creates empty div.

Created on 28 April 2013, over 11 years ago
Updated 9 June 2023, over 1 year ago

simpleads_block.tpl.php contains the following code snippet

<div class="header">
  <div class="ad-link"><?php if(!is_null($ads_page) && !empty($ads_page)) : print l(t('Advertise with us'), $ads_page); endif; ?></div>
</div>

If the inner test fails ($ads_page URL is not entered by the editor, but left blank) then it still creates a pair of nested divs

<div class="header">
<div class="ad-link"></div>
</div>

The css for class header is

.header {
    height: 105px;
    padding-top: 25px;
}

and this creates a 130px blank space between the level 2 header "Advertisement" and the image or text body of the advert. May I respectfully suggest that the code be changed to

<?php if(!is_null($ads_page) && !empty($ads_page)) : ?>
<div class="header">
  <div class="ad-link"> <?php print l(t('Advertise with us'), $ads_page); ?> </div>
</div>
<?php endif; ?> 

or similar. I believe it achieves the same result if the test is passed, but will not create the unsightly gap otherwise.
Maybe the true cause of the bug lies elsewhere and $ads_page is not being properly set up.

πŸ› Bug report
Status

Closed: won't fix

Version

1.9

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom pjaj

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024