I have an XSLT file that I'm using to get a list of assets from a specific directory. It's pulling from a text field. However, I'm getting the HTML paragraph tags around the output. How do I keep this from happening? caseStudyTitle is a text field and caseStudySummary is RichText. You can see from below that I'm actually seeing the <p> when rendered.
honestly, don't know how to remove those in xslt, in a template you can specify to strip paragraph, i guess you'll have use some jquery. Here's a nice thread post on how to remove the p tags
If you don't want the <p> tags the avoid using the RTE (TinyMCE). Just use a text multi line data type.
However, if you do want use the RTE, then take Bert's approach and style the p tags accordingly.
If you are having issues with the RTE sometimes outputting <p> and sometime not... just add a new line and then immediately delete it in the RTE. The <p> tags will now be applied.
Markup rendering from field referenced in XSTL
Hi,
I have an XSLT file that I'm using to get a list of assets from a specific directory. It's pulling from a text field. However, I'm getting the HTML paragraph tags around the output. How do I keep this from happening? caseStudyTitle is a text field and caseStudySummary is RichText. You can see from below that I'm actually seeing the <p> when rendered.
Here's the line from the XSTL:
<h2><xsl:value-of select="data [@alias = 'caseStudyTitle']"/></h2>
<xsl:value-of select="data [@alias = 'caseStudySummary']"/><a href="">more ></a>
However, when it renders, I get :
<h2>Test Study 1</h2>
<p>Summary of Case Study</p>
<a href="">more></a>
Do you know how to fix this?
Thanks!
--Kent
Hi kentiler,
use
Cheers,
/Dirk
A bit too fast, and introduced a typo:
<xsl:value-of select="data [@alias = 'caseStudySummary']" disable-output-escaping="yes"/>
Cheers,
/Dirk
Thanks, Dirk! There's one more thing I need.
When I make that change, it now shows up like this:
<div class="headlines"><img align="left" src="/media/20/imgPlaceHolder.png" width="86" height="73" alt="" /><h2>Test Study 1</h2>
<p>Summary of Case Study</p>
<a href="">more ></a></div>
Is there a way to keep the <p> tags from being added automatically around "Summary of Case Study"?
Thanks!
--Kent
honestly, don't know how to remove those in xslt, in a template you can specify to strip paragraph, i guess you'll have use some jquery. Here's a nice thread post on how to remove the p tags
http://groups.google.com/group/jquery-en/browse_thread/thread/4118943eb575dd75?pli=1
Hope this helps.
Regards,
/Dirk
Btw, will have to change the selector to get to the p tags in your code, but that shouldn't be such an issue.
Good luck with it.
/Dirk
You can always go for the lasy solution: Keep the tags, change the css. At least if your problem lies with how the html is displayed.
If you don't want the <p> tags the avoid using the RTE (TinyMCE). Just use a text multi line data type.
However, if you do want use the RTE, then take Bert's approach and style the p tags accordingly.
If you are having issues with the RTE sometimes outputting <p> and sometime not... just add a new line and then immediately delete it in the RTE. The <p> tags will now be applied.
Thank you all for your replies. I'll play around a bit and determine which one works best.
Have a great weekend!
--Kent
is working on a reply...