Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
using stylesheets in Templates
Lax
I need some help with templates. I am running into problems when I try to use the class from a style sheet in a template file.
This is an example.
iwpt_output("<b >$prec->{Headline}");
In the above line of code, I need to specify the stylesheet from which the styles for the bold tag needs to be picked up.
iwpt_output("<b class = "news" >$prec->{Headline}");
When the template has the above line of code, it throws an error. Is there an alternate way to achieve the result?
Thanks,
Find more posts tagged with
Comments
MattP
It is not well formed xml. The <b tag is never closed. I am not sure why you are using iwpt_output, but I will assume there is a reason.
How about
<b class="blah">iwpt_output("$prec->{Headline}");</b>
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
Lax
I had sent you only part of the code. This was the way it was:
else{ iwpt_output("<b >$prec->{Headline}");
}
iwpt_output("</b><br>");
I made the change that you suggested. It still gives me an error.
Thanks.
Any other suggestions??
akshathp
Just a guess before testing...
Could it be the
double quote within double quote
that could be generating this error? Have you tried escaping the double quotes for your class name or maybe don't use double quote for the class name in your < b > tag at all?
In the meanwhile I will test on my system too when I get a chance.
Hope this helps!
Akshat Pramod Sharma
Interwoven Inc.
Lax
Thanks Akshat.
Omitting the quotes does work. I hadn't thought to try without the quotes. Escaping the double quotes doesn't work. Thanks for your quick response.
MattP
Can you give me a little more info...
What is the error?
What does the rest of the code look like? The entire perl block..
Thanks
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
Lax
Thanks Matt,
It works when I use the class name without quotes. I had tried escaping the double quotes, but that hadn't worked.
Thanks for your help.
shanon
Hi.
So while omitting the quotes will get your code to run, it will not be "clean" HTML, as all attributes are supposed to be quoted.
Here's your code again:
iwpt_output("<b class = "news" >$prec->{Headline}");
and this is how to do it the "right" way (well, one syntax for it at least):
iwpt_output("<b class=\"news\">" . $prec->{Headline});
Shanon Levenherz
Mercer eBusiness Team
shanon.levenherz@mercer.com
http://www.mercerhr.com
Adam Stoller
or ...
iwpt_output("<b class='news'>" . $prec->{HeadLine});
or ...
iwpt_output(qq(<b class="news">$prec->{Headline}));
--fish
(Interwoven Senior Technical Consultant)
image.JPG