Can you embed a cross_site element inside an IE conditional

rrhill's Avatar

rrhill

10 Feb, 2011 06:27 PM

Is it possible to reference a cross-site resource in an IE conditional in a template (directly in the HTML not in XSL)?

We we have central website that serves common site elements (CSS, Javascript, images) for the standard set of templates we deploy on all (most) client sites. Since communication with our Cascade server is via SSL (https) and the central "asset" server serves only via HTTP, when a client is in Cascade, especially using IE, they get the mixed content error when viewing pages(the CSS is pulled from an HTTP site in an HTTPS environment). Since the content of the central asset site is maintained in Cascade, we use system-view tags to direct internal CSS links (for example) to the asset site instance and the published content pulls from the live asset serving site, neither:

[system-view:external]
<link href="http://cmsresources.edu/css/layout/common.css" media="screen" rel="stylesheet" type="text/css"/>
[/system-view:external]
[system-view:internal]
<link href="site://cmsresources/css/layout/common.css" media="screen" rel="stylesheet" type="text/css"/>
[/system-view:internal]

However, I can't see a way to have alternate IE conditional items linked this way sine it appears that you can't embed the site: link inside the conditional (the site: link ends up inside a comment and isn't executed?):

<!--[if IE]>
[system-view:external]
    <link rel="stylesheet" type="text/css" href="http://cmsresources.edu/css/ie_hacks.css" media="screen" />
[/system-view:external]
[system-view:internal]
    <link rel="stylesheet" type="text/css" href="site://cmsresources/css/ie_hacks.css" media="screen" />
[/system-view:internal]
<![endif]-->

or

[system-view:internal]  
<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="http://cmsresources.edu/css/ie_hacks.css" media="screen" />
<![endif]-->
[/system-view:internal]
[system-view:external]  
<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="[system-asset]site://cmsresources/css/ie_hacks.css[/system-asset]" media="screen" />
<![endif]-->
[/system-view:external]

work. Is this possible?

  1. 1 Posted by Lee Roberson (F... on 11 Feb, 2011 03:51 AM

    Lee Roberson (Function Digital LLC)'s Avatar

    It's not super clear to me why you want to send absolute URLs to the published copy but use internal references in the internal view. Since the CSS file mentioned is managed by Cascade it shouldn't produce IE mixed content errors... so it should be compatible to use site://sitename/folder/style.css for both? It also kind of looks like from your notes you're implying that your templates don't live in the same site as the shared CSS, images, and javascript, and if that's the case I wonder why that is too.

    We have a trick we use when writing HTML for sites that might have mixed-schema content: we use network path references, e.g. //site.com/css-file.css which will automatically fetch the CSS file from that server via http or https depending on which schema was used to fetch the host page. This doesn't help you based on the problem as stated, since you don't have HTTPS on the 'shared content server' but maybe you can work it in to your benefit?

    This reminds me of another thread I participated in: http://help.hannonhill.com/discussions/how-do-i/257-cross-site-link...

  2. 2 Posted by rrhill on 16 Feb, 2011 11:33 PM

    rrhill's Avatar

    I like your network path reference trick. Looks like Cascade complains about these links as being broken, however, it works in the browsers I've tested and validates as well.

  3. 3 Posted by Lee Roberson (F... on 17 Feb, 2011 02:31 PM

    Lee Roberson (Function Digital LLC)'s Avatar

    Awesome! It is sad that Cascade says the links are broken because that will make it harder for your team to determine when real publishing problems exist (if all those errors are in there) but I'm glad to hear that you found a way to make it work!

  4. 4 Posted by rrhill on 24 Feb, 2011 01:56 AM

    rrhill's Avatar

    Ran into a problem using scheme-relative links! If the template is housed in a central "model" site and a site accesses that template cross site, Cascade strips the preceding "/" of the double slashes in the URL, so it becomes /sever/path rather than //server/path

    Any ideas of why and how to fix?

  5. 5 Posted by rrhill on 24 Feb, 2011 02:01 AM

    rrhill's Avatar

    Turns out if we use three preceding slashes, Cascade strips one and all is good. Sorta. We don't trust it. Assuming its a bug and we use the three slash track, when the bug is fixed, all of our sites are trashed. We are in the middle of a major template site redesign and had hoped the scheme-relative links would fix our issues with mixed content elegantly. So, we need to know why this is occurring and how to proceed with confidence!

  6. 6 Posted by rrhill on 25 Feb, 2011 07:23 PM

    rrhill's Avatar

    Turns out we can include all of the off-site content using https calls, even on non-https pages. If a page is served using https and off-site content is included from a non-https site, browsers will report the mixed content issue. However, if the off-site content is served via https, then it doesn't matter if the page including that content is served via http or https. The browsers are fine with that. Makes sense.

    So, the solution is to always serve the external, global/common content from a https-enabled webserver and always include the content in Cascade using https calls.

  7. rrhill closed this discussion on 10 Mar, 2011 04:44 PM.

  8. rrhill re-opened this discussion on 10 Mar, 2011 04:45 PM

  9. Tim closed this discussion on 21 Jun, 2011 03:37 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac