Jump to content

Header {if $filename} statement not working as expected


jfialkowski

Recommended Posts

Hi folks. I have a site that I need the .whmcscontainer .contentpadded css object, to be transparent on certain pages. It seems to work when I visit the main page but if I click on a link to view an announcement, the css element doesn't change when the page loads. Its like its caching the header or something. Can anyone give me an idea of what I may be doing wrong and how I can make it work?

 

Here is my code from header.tpl.

 

 

<div class="whmcscontainer">
{if $filename eq "homepage" or "index" or "xen-vps-hosting" or "dedicated-servers" or "web-hosting"}
   <div class="contentpaddedclear">
{else}
   <div class="contentpadded>
{/if}

 

Here are the CSS elements:

 

 

 .whmcscontainer .contentpadded {
background-color: #FDFCFC;
       border-radius: 5px;
       padding: 20px;
}

.whmcscontainer .contentpaddedclear {
       background-color: transparent;
       border-radius: 5px;
       padding: 20px;
}

Link to comment
Share on other sites

Hi, please try

 


{if $filename eq 'homepage' or $filename eq 'index' or $filename eq 'xen-vps-hosting' or $filename eq 'dedicated-servers' or $filename eq 'web-hosting'}

OR

{if $filename eq 'homepage'  ||  $filename eq 'index'  ||  $filename eq 'xen-vps-hosting'  ||  $filename eq 'dedicated-servers'  ||  $filename eq 'web-hosting'}

 

instead of

 

{if $filename eq "homepage" or "index" or "xen-vps-hosting" or "dedicated-servers" or "web-hosting"}

Link to comment
Share on other sites

Hi, please try

 


{if $filename eq 'homepage' or $filename eq 'index' or $filename eq 'xen-vps-hosting' or $filename eq 'dedicated-servers' or $filename eq 'web-hosting'}

OR

{if $filename eq 'homepage'  ||  $filename eq 'index'  ||  $filename eq 'xen-vps-hosting'  ||  $filename eq 'dedicated-servers'  ||  $filename eq 'web-hosting'}

 

instead of

 

{if $filename eq "homepage" or "index" or "xen-vps-hosting" or "dedicated-servers" or "web-hosting"}

 

Thank you, that worked great.

 

Cheers,

 

Joe

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