Copied to clipboard

Flag this post as spam?

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


  • Ian Huntington 23 posts 53 karma points
    Jul 16, 2009 @ 13:24
    Ian Huntington
    0

    Adding HTML attributes to a value-of without using element

    Hello,

    I am currently working on a site which requires on certain pages to have the body text laid over an image. (The body text is a rich text editor field.) At the moment I'm not sure what the best approach to do this is as anything you type into the rich text editor is automatically appended the <p></p> tags. Here is my code snippet:

          <p class="intro noGapBottom whiteText">
            <xsl:value-of select="$currentPage/data [@alias = 'bodyText']" disable-output-escaping="yes"/>
          </p>

    I know I could use an xsl:element and xsl:attribute to add the intro, noGapBottom and whiteText classes but then I would need to change the field type of the bodyText to simple editor I presume but I do not want to do this.

    Any ideas would be welcomed.

    Thanks

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    Jul 16, 2009 @ 13:31
    Sebastiaan Janssen
    0

    You could look into the RemoveFirstParagraphTag() function, but from what I've seen of it, it's rather buggy. Besides, what if there is a second paragraph?

  • Ian Huntington 23 posts 53 karma points
    Jul 16, 2009 @ 13:32
    Ian Huntington
    0

    Argh ignore me. I've gone and got myself mixed up, baffoon.

Please Sign in or register to post replies

Write your reply to:

Draft