At the moment I’m looking for the comment tag (!–) and then parsing the whole block as text looking for the IE right conditional comment. Is there a better way of locating these tags in the tag tree?
Regards,
Tim.
I think you may want to just add your own cc block to the head as a tag, then you can alter it. There’s no harm in having multiple conditional comments in the page head – the only browsers affected are IE, and the only result will be a picosecond more processing time as the context shifts during the parse tree process. Those browsers are already fairly slow to render anything, so who’s going to notice?
Walter
On Sep 18, 2013, at 10:14 AM, Tim Plumb wrote:
I’m looking to add some CSS to the existing IE conditional comment that Freeway writes to the page head;
At the moment I’m looking for the comment tag (!–) and then parsing the whole block as text looking for the IE right conditional comment. Is there a better way of locating these tags in the tag tree?
Regards,
Tim.
I’m happy to leave this as it is (it works after all) but I’d rather tidy the code up if I can and place all of the styles together in a common IE conditional block. It would be nice if these were exposed through the Actions API so I can target them as easily as other tags on the page.
Thanks,
Tim.
On 18 Sep 2013, at 15:18, Walter Lee Davis wrote:
I think you may want to just add your own cc block to the head as a tag, then you can alter it. There’s no harm in having multiple conditional comments in the page head – the only browsers affected are IE, and the only result will be a picosecond more processing time as the context shifts during the parse tree process. Those browsers are already fairly slow to render anything, so who’s going to notice?
But can you nest conditional comments? I don’t think you can. Since each of these has a different match string in its opening marker, they have to remain separate statements anyway.
If you are building a conditional comment in your Action, you can always create a reference to that tag and stash it on the fwPage so other Actions in your control can access and alter it. But I would avoid looking for or altering Freeway’s own instances of these comments. That’s just me. I can see where you’re coming from here, having the same exact comment three times in a page would be bad. But from what you’ve shown me, these are and should remain separate comments.
Walter
On Sep 18, 2013, at 10:27 AM, Tim Plumb wrote:
Thanks for the prompt reply Walter.
This is a copy of the resulting HTML code I have at the moment and as you can see the two IE conditionals are the same;
I’m happy to leave this as it is (it works after all) but I’d rather tidy the code up if I can and place all of the styles together in a common IE conditional block. It would be nice if these were exposed through the Actions API so I can target them as easily as other tags on the page.
Thanks,
Tim.
On 18 Sep 2013, at 15:18, Walter Lee Davis wrote:
I think you may want to just add your own cc block to the head as a tag, then you can alter it. There’s no harm in having multiple conditional comments in the page head – the only browsers affected are IE, and the only result will be a picosecond more processing time as the context shifts during the parse tree process. Those browsers are already fairly slow to render anything, so who’s going to notice?
Walter Lee Davis, Wed, 18 Sep 2013 10:35:42 -0400:
But can you nest conditional comments? I don’t think you can. Since
each of these has a different match string in its opening marker,
they have to remain separate statements anyway.
If you are building a conditional comment in your Action, you can
always create a reference to that tag and stash it on the fwPage so
other Actions in your control can access and alter it. But I would
avoid looking for or altering Freeway’s own instances of these
comments. That’s just me. I can see where you’re coming from here,
having the same exact comment three times in a page would be bad. But
from what you’ve shown me, these are and should remain separate
comments.
Walter
On Sep 18, 2013, at 10:27 AM, Tim Plumb wrote:
Thanks for the prompt reply Walter.
This is a copy of the resulting HTML code I have at the moment and
as you can see the two IE conditionals are the same;
I’m happy to leave this as it is (it works after all) but I’d rather
tidy the code up if I can and place all of the styles together in a
common IE conditional block. It would be nice if these were exposed
through the Actions API so I can target them as easily as other tags
on the page.
Thanks,
Tim.
On 18 Sep 2013, at 15:18, Walter Lee Davis wrote:
I think you may want to just add your own cc block to the head as a
tag, then you can alter it. There’s no harm in having multiple
conditional comments in the page head – the only browsers affected
are IE, and the only result will be a picosecond more processing
time as the context shifts during the parse tree process. Those
browsers are already fairly slow to render anything, so who’s going
to notice?
Hi Walter,
Unless I’m missing something obvious (it happens to me now and then) both of these conditionals should equate to the same thing - if lt IE7 matches IE6, IE 5.5, IE 5, etc and if lte IE6 matches IE6, IE 5.5, IE 5, etc. - which is why I wanted to consolidate the styles in the same conditional block if I could. In the end I went for a belt and braces solution of looking for the conditional comment and adding my own in if it couldn’t be located.
Thanks,
Tim.
On 18 Sep 2013, at 15:35, Walter Lee Davis wrote:
But can you nest conditional comments? I don’t think you can. Since each of these has a different match string in its opening marker, they have to remain separate statements anyway.
Aha. That’s good to know. But this could easily become a bug-hunt if you end up with a nested set that can never reach the inner condition.
Walter
On Sep 18, 2013, at 10:44 AM, Leif Halvard Silli wrote:
A conditional comment may either take the form
<![if foo]>…<![endif>
or, the more common, HTML comment compatible form
thus you can nest them:
Leif H Silli
Walter Lee Davis, Wed, 18 Sep 2013 10:35:42 -0400:
But can you nest conditional comments? I don’t think you can. Since
each of these has a different match string in its opening marker,
they have to remain separate statements anyway.
If you are building a conditional comment in your Action, you can
always create a reference to that tag and stash it on the fwPage so
other Actions in your control can access and alter it. But I would
avoid looking for or altering Freeway’s own instances of these
comments. That’s just me. I can see where you’re coming from here,
having the same exact comment three times in a page would be bad. But
from what you’ve shown me, these are and should remain separate
comments.
Walter
On Sep 18, 2013, at 10:27 AM, Tim Plumb wrote:
Thanks for the prompt reply Walter.
This is a copy of the resulting HTML code I have at the moment and
as you can see the two IE conditionals are the same;
I’m happy to leave this as it is (it works after all) but I’d rather
tidy the code up if I can and place all of the styles together in a
common IE conditional block. It would be nice if these were exposed
through the Actions API so I can target them as easily as other tags
on the page.
Thanks,
Tim.
On 18 Sep 2013, at 15:18, Walter Lee Davis wrote:
I think you may want to just add your own cc block to the head as a
tag, then you can alter it. There’s no harm in having multiple
conditional comments in the page head – the only browsers affected
are IE, and the only result will be a picosecond more processing
time as the context shifts during the parse tree process. Those
browsers are already fairly slow to render anything, so who’s going
to notice?
Thanks for the clarification, Leif. I am certain that a smart human would get it right, but Actions are feeble brutes, and often run in an unexpected order, even if all of them were written by you, and you’re not dealing with someone else’s good idea of how this should be done.
Walter
On Sep 18, 2013, at 11:31 AM, Leif Halvard Silli wrote:
First: I wrote <![endif> and <![endif–>. But of course,
I meant <![endif]> and <![endif]–>
(just in case someone is copy-pasting ….)
Second: What I had in mind was something like this, which sounded as if
it was what Tim looked for - no complicated nesting problems here:
Leif
Walter Lee Davis, Wed, 18 Sep 2013 10:53:38 -0400:
Aha. That’s good to know. But this could easily become a bug-hunt if
you end up with a nested set that can never reach the inner condition.
Walter
On Sep 18, 2013, at 10:44 AM, Leif Halvard Silli wrote: