Jump to content

Change Image by page called from header.tpl


Recommended Posts

Hello All,

 

I have a custom template which calls a banner for each page in the system. I want to be able to change this banner based on the page - i.e. vpshosting.tpl should display another image, and dedicated,tpl would show another etc. etc.

 

The problem is the header.tpl calls the image - not the individual page tpl.

 

Any ideas or advice would be great.

Link to comment
Share on other sites

Guest HardSoftCode

Hi

 

You can use this in the header

 

{if $filename == 'index'} // if the page url index.php

## add your code here

{elseif $filename == 'vpshosting'} // if the page url vpshosting.php

## add your code here

{/if}

Link to comment
Share on other sites

Thanks for the response but I am confused by this.

 

The header already calls in a DIV called "Innerbanner" - I just want to replace this with say "Innerbanner1" for the page (lets say the page called affiliates) - so I am not sure which code goes where.

 

Sorry for the newbie responseto you helpful post.

Link to comment
Share on other sites

Thanks for the response but I am confused by this.

 

The header already calls in a DIV called "Innerbanner" - I just want to replace this with say "Innerbanner1" for the page (lets say the page called affiliates) - so I am not sure which code goes where.

 

Sorry for the newbie responseto you helpful post.

 

 

 

{if $filename == 'index'} // if the page url index.php

<div class="innerbanner"></div>

{elseif $filename == 'vpshosting'} // if the page url vpshosting.php

<div class="innerbanner1"></div>

{elseif $filename == 'affiliates'} // if the page url affiliates

<div class="innerbanner2"></div>

{/if}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated