[SOLVED] testing for https in stylesheet and update URLs
Posted: Wed Dec 14, 2011 11:00 pm
{cms_stylesheet} wants absolute links to background images which I set with [[root_url]] as suggested.
I need to change this when the stylesheet is loaded via https. so i put some code up the top: (I also tried "On" and "1")
and later called background images like this
but the if statement always returns the http URL.
how can I change the URL based on the connection?
I need to change this when the stylesheet is loaded via https. so i put some code up the top:
Code: Select all
[[if $smarty.server.HTTPS eq "on"]]
[[assign var='imageURL' value='https://secure.myurl.com']]
[[else]]
[[assign var='imageURL' value='http://www.myurl.com']]
[[/if]]
and later called background images like this
Code: Select all
background: url([[$imageURL]]/uploads/images/background/backsprite_all.png) -10px -966px no-repeat;
how can I change the URL based on the connection?