Results 1 to 5 of 5

Thread: Ability to define different header and footer

  1. #1
    Join Date
    Dec 2007
    Posts
    113

    Default Ability to define different header and footer

    Currently you can only use one header and footer tpl file or all areas of whmcs. The problem is that sometimes you want to have different styles for different areas of whmc (eg. Support area VS Shopping cart area). An example that highlights the problem is when using css usually most of your sidebar code goes into the footer (which means that every whmcs sidebar area would be identicle). The only way to get around this is to move your sidebar code into every single page. If you could define different header or footer tpl for different areas then you wouldn't have to change every single template.

  2. #2
    Join Date
    Sep 2007
    Location
    Newcastle, UK
    Posts
    2,771

    Default

    Quote Originally Posted by danami View Post
    The only way to get around this is to move your sidebar code into every single page.
    That's what I did, it doesn't take very long.
    Valcato Hosting - 8 years in the business

  3. #3
    Join Date
    Jul 2005
    Location
    UK
    Posts
    8,437

    Default

    Why not just use an if check to display different HTML code based on the page name?

    Matt
    WHMCompleteSolution
    The Complete Client Management, Billing & Support Solution
    www.whmcs.com

  4. #4
    Join Date
    Dec 2007
    Posts
    113

    Default

    Quote Originally Posted by Matt View Post
    Why not just use an if check to display different HTML code based on the page name?
    Matt
    That's probably what I'll end up doing. The only problem that I see with that is maintainability with future upgrades. As new changes are made you are constantly going to have to monitor new page names.

  5. #5
    Join Date
    Dec 2007
    Posts
    113

    Default

    Just in case anyone needs to do this here is an example:

    1. Create a different footer for your support and cart area (eg. footer_support.tpl and footer_cart.tpl)
    2. Move all your footer code into the new files
    3. Add this code to your default footer.tpl
    Code:
    {if $SCRIPT_NAME eq '/whmcs/cart.php'}
    {include file="default/footer_cart.tpl"}
    {else}
    {include file="default/footer_support.tpl"}
    {/if}
    Matt thanks for pointing out $SCRIPT_NAME .. I wasn't aware that variable was available in the templates.
    Last edited by danami; 03-16-08 at 05:17 PM.

Similar Threads

  1. Disable header and footer
    By Kian in forum Customisation & Integration Questions
    Replies: 11
    Last Post: 03-19-13, 12:38 PM
  2. Custom header and footer
    By khurramalvi in forum Feature Requests
    Replies: 5
    Last Post: 08-24-10, 12:42 AM
  3. Want to have custom header and footer on some pages. But not all.
    By broschats in forum Customisation & Integration Questions
    Replies: 3
    Last Post: 12-17-09, 12:33 AM
  4. Ability to define name servers on new domain orders
    By zigzam in forum Feature Requests
    Replies: 3
    Last Post: 04-20-08, 05:28 PM