ssoylu1996 Posted April 1, 2013 Share Posted April 1, 2013 (edited) 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 April 1, 2013 by ssoylu1996 I used .php extension, It should be .tpl 0 Quote Link to comment Share on other sites More sharing options...
DavidBee Posted April 1, 2013 Share Posted April 1, 2013 You could mess around with if statements but why not simply edit the homepage.tpl and put the slider at the top. 0 Quote Link to comment Share on other sites More sharing options...
ssoylu1996 Posted April 1, 2013 Author Share Posted April 1, 2013 (edited) 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 April 1, 2013 by ssoylu1996 0 Quote Link to comment Share on other sites More sharing options...
MemoryX2 Posted April 1, 2013 Share Posted April 1, 2013 (edited) {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 April 1, 2013 by MemoryX2 More info 0 Quote Link to comment Share on other sites More sharing options...
ssoylu1996 Posted April 2, 2013 Author Share Posted April 2, 2013 (edited) {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 April 2, 2013 by ssoylu1996 0 Quote Link to comment Share on other sites More sharing options...
MemoryX2 Posted April 3, 2013 Share Posted April 3, 2013 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. 0 Quote Link to comment Share on other sites More sharing options...
ssoylu1996 Posted April 3, 2013 Author Share Posted April 3, 2013 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" 0 Quote Link to comment Share on other sites More sharing options...
Pixelior Posted April 4, 2013 Share Posted April 4, 2013 I see.. Is there a code for something like "if file is not index display this" Contents.. "/if" I haven't tested it but you can give a try: {if $filename != 'index'} Content you would like to add for every page except index {/if} 0 Quote Link to comment Share on other sites More sharing options...
ssoylu1996 Posted April 4, 2013 Author Share Posted April 4, 2013 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! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.