wildman Posted July 24, 2012 Share Posted July 24, 2012 I need to put a div around the content area of the entire site except the homepage. I tried: <div class="mainpagecontainer"> php etc of whmcs pages </div> but it is not working. I know WHMCS has "WHMCS Container" however the problem here is when you edit homepage.tpl it puts it inside this container. The homepage is different than the whmcs pages. I need the homepage with in WHMCS though for various code snippets. How can I put a new class div around whmcs pages to achieve the same effect so it will work? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
wildman Posted July 25, 2012 Author Share Posted July 25, 2012 Does anyone know? 0 Quote Link to comment Share on other sites More sharing options...
Blueberry3.14 Posted July 25, 2012 Share Posted July 25, 2012 I need to put a div around the content area of the entire site except the homepage. I tried: <div class="mainpagecontainer"> php etc of whmcs pages </div> but it is not working. I know WHMCS has "WHMCS Container" however the problem here is when you edit homepage.tpl it puts it inside this container. The homepage is different than the whmcs pages. I need the homepage with in WHMCS though for various code snippets. How can I put a new class div around whmcs pages to achieve the same effect so it will work? Thanks! What worked for me might be what you're looking for. I added a <div> to each page by adding the opening <div> tag to the bottom of the header.tpl, and the closing </div> tag to the footer.tpl. Placement within each .tpl would of course depend on what you're trying to accomplish. To have this excluded on the homepage could likely be accomplished by some CSS rules, or you could even add a PHP if clause (basically "if this page is not 'XYZ', display the following" around the new div tags). I had a block of code I display in the footer for every page but the index.php page, and it works well. If that's what you're looking to do, let me know and I'll post the code I use. 0 Quote Link to comment Share on other sites More sharing options...
wildman Posted July 26, 2012 Author Share Posted July 26, 2012 If there is an (IF) rule that can make it so that a certain css rule is not shown on the homepage then this will fix everything. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Blueberry3.14 Posted July 27, 2012 Share Posted July 27, 2012 This will get you started (as close as I could come to without knowing the particular details of what you're trying to do). {php} if ($_SERVER['PHP_SELF'] != "index.php") { {/php} [i] Include in here only what you want displayed in the index.php page.[/i] {php} } else if ($_SERVER['PHP_SELF'] == "index.php") { echo "Hello!"; } {/php} This is based on the URL of the page, in this case "index.php." It'[s set to show the block of text (or whatever you want) only if the page [i]is not[/i] "index.php." You could always flip it around to show the block of text only if the page URL *is* "index.php." It could also be a straight forward "if" statement (if this page is/is not index.php, display this). Again depending on what you're trying to do, you could create div's with a class and CSS that you either want to show on only one page, or show on all pages except that one page. 0 Quote Link to comment Share on other sites More sharing options...
wildman Posted July 27, 2012 Author Share Posted July 27, 2012 Thanks, Will try that. 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.