Jump to content

Different Header on Homepage


Recommended Posts

Hi,

 

I am using WHMCS Software for my website. What I need help with is that, I want to have another Header.php that is slightly different from all the other pages because i want to have a slider on the homepage header, just under the navigation but if i edit header.php the slider shows on every page.

 

So, is it possible to duplicate header.tpl to header_home.tpl so I can modify it without having to display on the other pages too.

 

Thank You.

Edited by ssoylu1996
I used .php extension, It should be .tpl
Link to comment
Share on other sites

I have tried editing the homepage.tpl, however i want the top area of slideshow slightly behind the navigation because the navigation background is plain and needs something to cover it. I can modify this and apply the slider to the header but i dont want it displaying on all pages.

 

Could you tell me which "If Statements" I could edit?

Edited by ssoylu1996
Link to comment
Share on other sites

{if $filename eq "index"}

Whatever you want for the home page

{ELSE}

What you want for all other pages

{/if}

 

This code also works good for menus as well.

 

It can be expanded for something like this:

 

 {if $filename eq "index" or $filename eq "domainchecker" or $filename eq "whateverPage"}

{/if}

Edited by MemoryX2
More info
Link to comment
Share on other sites

{if $filename eq "index"}

Whatever you want for the home page

{ELSE}

What you want for all other pages

{/if}

 

This code also works good for menus as well.

 

It can be expanded for something like this:

 

 {if $filename eq "index" or $filename eq "domainchecker" or $filename eq "whateverPage"}

{/if}

 

I've done what you have said but, when I go to other pages there is no header and at the homepage, there is something like a double header right now.

 

I have edited the header.tpl, thats correct?

 

{ELSE} is not quite working..

 

Could this be the problem?

{if $filename eq "index"}
         some content..
                 {if $loggedin}
                   navigation list stuff
                  {else}
                   non-registered client navigation stuff
                  {/if}
{else}
         some content..
                 {if $loggedin}
                   navigation list stuff
                  {else}
                   non-registered client navigation stuff
                  {/if}
{/if}

Edited by ssoylu1996
Link to comment
Share on other sites

Well basically you would keep the header code the same throughout the site.

 

Then for the slideshow you would have something like this after your header.

 

{if $filename eq 'index"} slideshow stuff {/if}

 

Guess theirs really no need for the else part of the statement.

 

Hope this helps some.

Link to comment
Share on other sites

Well basically you would keep the header code the same throughout the site.

 

Then for the slideshow you would have something like this after your header.

 

{if $filename eq 'index"} slideshow stuff {/if}

 

Guess theirs really no need for the else part of the statement.

 

Hope this helps some.

I see.. Is there a code for something like "if file is not index display this" Contents.. "/if"

Link to comment
Share on other sites

Hi,

 

Thank you so much for your help, I used:

 

{if $filename eq 'index'} slideshow stuff {/if}

to display the slideshow on the header for the homepage. Then I added the original header using this:

 

{if $filename != 'index'}
pages other than index
{/if}

i repeated this with the CSS links because i was having a couple of problems with the design and I am using two seperate stylesheets now. But everything is working the way i want to.

 

Thank You!

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