Jump to content

Smarty: How to write if https display xxx /if ?


50cent

Recommended Posts

Hi all,

I've been trying to work this out but I'm not getting anywhere.
I want to display our SSL site seal only on secure 'https' pages.

I therefore need to be able to write the following in smarty header.tpl:

{if https} xxx {/if}

I've tried:

{if $HTTP_SERVER_VARS['HTTPS'] == "ON"} display content {/if}
{if $HTTP_SERVER_VARS['HTTPS']} display content {/if}
{if $https} display content {/if}



But it's not working.

Can anybody help?

Cheers!

Link to comment
Share on other sites

Thanks for your reply.

I tried your method - however it returns 'https' even on pages where the address begins 'http'.

So in the end I have solved the issue using java_script:

[removed]{literal}

var addy = [removed].href;
if((addy.substring(0,5) == 'https'))
   {
       [removed]("[removed]<\/script>");                                   
   }
{/literal}[removed]



Cheers
50cent

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...