ProsePoint Express: hosted newspaper website content management software

How to add a block for topbanner?

7 replies [Last post]
Robert.Munro
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/04/2009
Posts:

How can one add a block to replace or override the topbanner area?

I understand that themes can place images in topbanner, but I'm wondering if I can replace or override that default with, say... and ad block.  I mean, that topbanner space is only the most valuable item on any website.

Robert

 

beng
User offline. Last seen 6 days 16 hours ago. Offline
Joined: 27/02/2009
Posts:
A feature request.

Hi,

Sorry, but the default theme doesn't provide a block region where the topbanner image is. I'll move this to the wishlists forum since it's worth considering adding for the future.

(If you know how to do Drupal themeing, you could modify the theme yourself, but that's probably beyond the scope of this discussion)

Robert.Munro
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/04/2009
Posts:
Well, I've defined a block for topbanner...

I edited ~/sites/default/themes/tma_custom/page.tpl.php & ~/sites/default/themes/tma_custom/tma_custom.info to get a block defined for the "topbanner" area.

However, the /header images hierarchy of the enabled themes apparently still fills out that area on all pages for which topbanner elements are defined.  That's to be expected, I suppose, since those directives are still there.  I guess that if I put anything in that block it would appear either in front of or behind the header image.

Do I need to go through the themes that are enabled and comment out the topbanner header image definitions?  Would that work?  It seems so hackish.  Or is there some way to override these in the subtheme?

Robert

 

beng
User offline. Last seen 6 days 16 hours ago. Offline
Joined: 27/02/2009
Posts:
Override with CSS background: none

I think you are now referring to CSS declarations which are placing background images in the topbanner area for certain pages.

You can override these declarations, and turn off the background image by using background: none or some other similar CSS declaration.

Robert.Munro
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/04/2009
Posts:
That works to clear the

That works to clear the topbanner background.  I've got a block defined there, so this wish is resolved, I believe.

Thanks!

 

Robert.Munro
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/04/2009
Posts:
Er... topbanner block isn't working
Guess I spoke too soon.  All the pieces look to be there, but I still can't display an ad in the topbanner area.

Here is what I have in the ~/sites/default/themes/tma_custom/tma_custom.info file:

; Regions
...
regions[topbanner]      = topbanner

And in the ~/sites/default/themes/tma_custom/page.tpl.php file:

<code>

<div id="topbanner" class="region region-topbanner">
<?php print $topbanner; ?>

<?php if ($breadcrumb): ?>
<?php print $breadcrumb; ?>
<?php endif; ?>
</div> <!-- /#topbanner -->

</code>

I added the class to the first line, and added the next "print" line after that.  That created the topbanner block. It shows up highlighted yellow in the admin list blocks display.

Then I created another banner ad in openx and entered its invocation code in the openx plugin module.  I moved the banner item into the topbanner block and saved the list, then cleared the theme registry and cache.

But the banner doesn't display.  Actually, I tried two banners - the first 965x60px using a background header, and the second one smaller, 600x65px.  The invocation code is in the page source, but the banner doesn't display.

Could that "breadcrumb" code be interfering with the banner image display in the this new topbanner block?

Robert

Robert.Munro
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/04/2009
Posts:
Um... yes, it does work

Thought I was wrong, but was mistaken.  Ads in the topbanner area do work now.  OpenX is a little confusing.

So the code I posted above (plus overriding the topbanner background in the CSS) shows how to do this.

Robert

liksanne
User offline. Last seen 2 years 39 weeks ago. Offline
Joined: 07/05/2009
Posts:
That's to be expected, I

That's to be expected, I suppose, since those directives are still there. I guess that if I put anything in that block it would appear either in front of or behind the header image.

Thanks
______

betsson