Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kentiler 76 posts 69 karma points
    Aug 21, 2009 @ 06:50
    kentiler
    0

    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 &gt;</a>

    However, when it renders, I get :

    <h2>Test Study 1</h2>
    &lt;p&gt;Summary of Case Study&lt;/p&gt;
    <a href="">more&gt;</a>

     

    Do you know how to fix this?

    Thanks!

    --Kent

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 21, 2009 @ 07:24
    Dirk De Grave
    0

    Hi kentiler,

    use

     <xsl:value-of select="data [@alias = 'caseStudySummary']"/ disable-output-escaping="yes">

     

    Cheers,

    /Dirk

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 21, 2009 @ 07:26
    Dirk De Grave
    1

    A bit too fast, and introduced a typo:

     

     <xsl:value-of select="data [@alias = 'caseStudySummary']" disable-output-escaping="yes"/>

    Cheers,

    /Dirk

  • kentiler 76 posts 69 karma points
    Aug 21, 2009 @ 16:42
    kentiler
    0

    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 &gt;</a></div>

    Is there a way to keep the <p> tags from being added automatically around "Summary of Case Study"?

    Thanks!

    --Kent

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 21, 2009 @ 16:54
    Dirk De Grave
    0

    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

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 21, 2009 @ 16:55
    Dirk De Grave
    0

    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

  • Bert 128 posts 251 karma points
    Aug 21, 2009 @ 17:43
    Bert
    0

    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.

    div.headlines p{...}
  • Chris Koiak 700 posts 2626 karma points
    Aug 21, 2009 @ 17:50
    Chris Koiak
    1

    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.

  • kentiler 76 posts 69 karma points
    Aug 21, 2009 @ 23:59
    kentiler
    0

    Thank you all for your replies.  I'll play around a bit and determine which one works best.

    Have a great weekend!

     

    --Kent

Please Sign in or register to post replies

Write your reply to:

Draft