Jump to content

Simple fix?


wildman

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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