Search code examples
blogger

b:if selection which works for both http and https


Is it possible to have a condition which covers both HTTP and https link in b:if condition selection.

<b:if cond='data:blog.url == &quot;http://www.your-site.com/p/contact-us.html&quot;'>
<link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
<b:else/>
    <b:if cond='data:blog.url == &quot;https://www.your-site.com/p/contact-us.html&quot;'>
    <link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
  </b:if>
</b:if>

This is how I got loading of this CSS working in both HTTP and https version of the website. Is there a single way to do without the ?


Solution

  • <b:if cond='data:blog.url contains "//www.your-site.com/p/contact-us.html"'>
      <link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
    </b:if>