Categories > TinyButStrong general >

Disabling TBS parsing within template

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: chichilatte
Date: 2007-10-19
Time: 15:08

Disabling TBS parsing within template

Am I being a total dufus? I can't find anywhere in the manual an explanation of...

How to turn off parsing within my template document

For example, at the start of my template I have a CSS conditional statement to serve Internet Explorer7 its very own CSS document:
<!--[if IE 7]>
<style type="text/css">@import url('[vars.base_url]css/default_strict_ie7.css');
</style>
<![endif]-->
Now the stuff in the square brackets at the start and end...
[if IE 7] ... [endif]
is not TBS code, it's Internet Explorer code.

Unfortunately, TBS tries to parse them, and IE7 doesn't understand the result:
<!--&#91;if IE 7]>
<style type="text/css">@import url('http://localhost/trunk/css/default_strict_ie7.css');
</style>
<!&#91;endif]-->

And so IE7 doensn't get its CSS document, and my page looks squiffy. How can I turn off TBS parsing for these two little bits?
By: chichilatte
Date: 2007-10-19
Time: 15:31

Re: Disabling TBS parsing within template

I even tried this in the template...
[var.openBracket;htmlconv=no]if IE 7]
and in the php...
$openBracket = '[';

but there's no change in the html produced :(


I would have thought a facility for turning off parsing would be absolutely essential for a template engine, eg. when parsing javascript which contains array accessing operators (the square brackets)
By: Skrol29
Date: 2007-10-19
Time: 22:24

Re: Disabling TBS parsing within template

By: chichilatte
Date: 2007-10-22
Time: 14:48

Re: Disabling TBS parsing within template

Thanks Skrol29, that worked perfectly.

I notice also that the conversion of [ to &#91; only happens to variables. It doesn't happen to any square brackets in the actual template itself (eg. If you have some javascript in your main html). Just for everyone's edification!

thanks a lot

chichilatte