Custom HTTP and HTTPS

Jan 6, 2013 at 3:47 AM

I'm using Google WebFonts in my skin.

This requires inserting the following CSS into the HEAD:
     http://fonts.googleapis.com/css?family=Signika:400 
and on Secure Pages
    https://fonts.googleapis.com/css?family=Signika:400 

This skin object works great, except on SSL pages. 
Is there a way to make it insert HTTPS on secure pages and HTTP on normal pages?

Coordinator
Feb 14, 2013 at 3:34 PM
Sorry, missed you post.

Might work with IfUrl="http:*" and IfUrl = "https:", not sure.
If not, please create an issue and I'll add this to the next version.

Timo
Feb 15, 2013 at 1:14 AM
I ended up writing my own skin object for this task, but I of course would rather use just one.

I just tried your suggestion and It sort of worked.
It detected http and https and used the correct object
However, if stripped out my URL and parsed it into 3 different link tags with RelativeURLs (dead links in this case)

Here was my code, does it not handles pipes?
<fortyfingers:STYLEHELPER ID="sh1" runat="server" 
    IfURL="http://*"
    AddCssFile="http://fonts.googleapis.com/css?family=Signika:400,700|Marvel:400,700|Montserrat:400,700"
/>
<fortyfingers:STYLEHELPER ID="sh2" runat="server"  
    IfURL="https://*"
    AddCssFile="https://fonts.googleapis.com/css?family=Signika:400,700|Marvel:400,700|Montserrat:400,700"
/>
Thanks for your help.
Coordinator
Feb 15, 2013 at 10:04 AM
A pipe is used to pass multiple items, but that should be split on a double pipe ||
If it splits one a single pipe, that's a bug I think.
I'll have a look at it.

Thanks for you Feedback,

Timo
Coordinator
Feb 15, 2013 at 10:11 AM
Oh, I see now.
You used addcssfile, that splits on a comma (historically).

It's better to use AddToHead like this:

<fortyfingers:STYLEHELPER ID="sh1" runat="server" IfURL="http://*" AddToHead="<link href='http://fonts.googleapis.com/css?family=Signika:400,700|Marvel:400,700|Montserrat:400,700' rel='stylesheet' type='text/css'></link>" />

That should work.