Banner For Each Forum

fords8

Active member
I would like to add a different banner for each forum.

So if I have a category for games and have forums under it for COD, BF3, FEAR, and so on. When a user clicks on the COD forum, at the top of it I want to have a banner for COD. Same for BF3 and so on.

Thanks for any help!

EDIT: I should of also said that I wanted the banner to be in the center.
 
Edit this template to replace the title image for specific forums:

Admin CP -> Appearance -> Templates -> logo_block

Add the red code:

Rich (BB code):
<div id="logoBlock">
	<div class="pageWidth">
		<div class="pageContent">
			<xen:include template="ad_header" />
			<xen:hook name="header_logo">
			<div id="logo"><a href="{$logoLink}">
				<span><xen:comment>This span fixes IE vertical positioning</xen:comment></span>
				<xen:if is="{$forum.node_id} == 2">
					<img src="path/to/image.gif" alt="{$xenOptions.boardTitle}" />
				<xen:elseif is="{$forum.node_id} == 8" />
					<img src="path/to/image.gif" alt="{$xenOptions.boardTitle}" />
				<xen:else />
					<img src="@headerLogoPath" alt="{$xenOptions.boardTitle}" />
				</xen:if>
			</a></div>
			</xen:hook>
			<span class="helper"></span>
		</div>
	</div>
</div>

Add more xen:elseif's to the middle to check more node_ids.
 
  • Like
Reactions: Kim
In that case use this template:

Admin CP -> Appearance -> Templates -> ad_below_top_breadcrumb

Rich (BB code):
<div style="text-align: center;">
	<xen:if is="{$forum.node_id} == 2">
		<img src="path/to/image.gif" />
	<xen:elseif is="{$forum.node_id} == 8" />
		<img src="path/to/image.gif" />
	</xen:if>
</div>
 
Hey Jake thanks. That will work out great. Thanks for your time. Would be great if a mod was made for this. Maybe when you make a new forum, add a spot to put your banner link into.
 
In that case use this template:

Admin CP -> Appearance -> Templates -> ad_below_top_breadcrumb

Rich (BB code):
<div style="text-align: center;">
 <xen:if is="{$forum.node_id} == 2">
 <img src="path/to/image.gif" />
 <xen:elseif is="{$forum.node_id} == 8" />
 <img src="path/to/image.gif" />
 </xen:if>
</div>
I inserted this code to add a banner to my forums, but where do I go to insert the image or link to display the image for that matter?
 
The banner would go on the line where it says
Code:
"path/to/image.gif"

You could also use a full link and graphic there....

fords - there are a number of ways you can show different banners in each forum based on the node ID. I use an external program to serve those....

As an example, you can build a unique URL using the forum node id - using Javascript. I use a hacked together piece which calls banners from an external program..this allows me to rotate banners, control displays, etc.

Here is the Javascript I use which will build and call a URL (a perl script in my case) which is unique to the forum and to the ad placement location:

Code:
<xen:hook name="ad_thread_view_below_messages" />
 
<xen:if is="{$forum.node_id} > 0">
 
<div style="text-align: center;">
 
<script type="text/javascript">
 
function staticLoadScript(url)
{
  document.write('<script src="', url, '" type="text/JavaScript"><\/script>');
}
 
staticLoadScript("http://hearth.com/cgi-bin/forumbottom" + {$forum.node_id} + '.' + "pl?jscript");
 
</script>
 
</div>
</xen:if>
 
Ok, So I am confused...

Rich (BB code):
<div style="text-align: center;">
 <xen:if is="{$forum.node_id} == 2">
 <img src="path/to/image.gif" />
 <xen:elseif is="{$forum.node_id} == 8" />
 <img src="path/to/image.gif" />
 </xen:if>
</div>

I completely understand where the link goes for the image I will be using (Note: the quoted image)
And above it is referenced to place the code in the following:

Admin CP -> Appearance -> Templates -> ad_below_top_breadcrumb

But I want each individual forum category to have its own image. For example, if I select the Call Of Duty category it will open up another forum. There I want to add a banner for COD. Then I want to do the same for Madden, then NBA2k and so on and so on. Does this make sense?
 
Hmm...let me try to give some help with the framework here....

1. You need to upload the banners yourself to somewhere - example
http://www.mysite.com/banners/

2. So, let's pretend you had three forums - each has a node_id - 1,2,3
1 is madden, 2 is COD, 3 is NBA

3. So you create three banners and put them in the banner directory....you name them
madden.jpg, cod.jpg and nba.jpg

4. The code to display the above in the forums would be
Code:
<div style="text-align: center;">
<xen:if is="{$forum.node_id} == 1">
<img src="banners/madden.jpg" />
<xen:if is="{$forum.node_id} == 2">
<img src="banners/cod.jpg" />
<xen:elseif is="{$forum.node_id} == 3" />
<img src="banners/nba.jpg" />
</xen:if>
</div>

Or something like that! I don't do a lot of ifs, so not sure if that's the way to nest them.......but basically each line can be translated as

"If we are in forum named (this), then pull this banner....."

Does that sound right?
 
I wasn't talking that way...just that I wrote manuals for products in the past....
:)

At the same time I was writing this to you, another member here wrote one like it to me...explaining a similar thing!

Glad it's starting to work....as I said, not sure if you use the two esleifs...might be all if's until the last one...
 
In that case use this template:

Admin CP -> Appearance -> Templates -> ad_below_top_breadcrumb

Rich (BB code):
<div style="text-align: center;">
 <xen:if is="{$forum.node_id} == 2">
 <img src="path/to/image.gif" />
 <xen:elseif is="{$forum.node_id} == 8" />
 <img src="path/to/image.gif" />
 </xen:if>
</div>

Can you not use this code for a category? I even changed the word Forum to Category and still.. no luck
 
Edit this template to replace the title image for specific forums:

Admin CP -> Appearance -> Templates -> logo_block

Add the red code:

Rich (BB code):
<div id="logoBlock">
<div class="pageWidth">
<div class="pageContent">
<xen:include template="ad_header" />
<xen:hook name="header_logo">
<div id="logo"><a href="{$logoLink}">
<span><xen:comment>This span fixes IE vertical positioning</xen:comment></span>
<xen:if is="{$forum.node_id} == 2">
 <img src="path/to/image.gif" alt="{$xenOptions.boardTitle}" />
 <xen:elseif is="{$forum.node_id} == 8" />
 <img src="path/to/image.gif" alt="{$xenOptions.boardTitle}" />
 <xen:else />
<img src="@headerLogoPath" alt="{$xenOptions.boardTitle}" />
</xen:if>
</a></div>
</xen:hook>
<span class="helper"></span>
</div>
</div>
</div>

Add more xen:elseif's to the middle to check more node_ids.

Will this code allow me to place a banner or the like in the forums in a similar fashion to this site;

http://www.mazdaspeedforums.org/forum/

In the Mazda Speed Forum Sponsors.

I would also like the banner to link back to the sponsors' own site.

Thanks in advance
 
Top Bottom