Copied to clipboard

Flag this post as spam?

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


  • Garry Bain 149 posts 124 karma points
    Sep 08, 2011 @ 15:46
    Garry Bain
    0

    Twitter package and XSLT

    Hi everyone,

    I have just installed the twitter package from http://our.umbraco.org/projects/website-utilities/twitter-for-umbraco and edited the XSLT to show only the latest tweet. However, I have limited space on my design so I'd like to only show a maximum number of characters from the tweet.

    Is this possible using the XSLT, somehow editing the line below that pulls the tweet in?

    <xsl:value-of select="CWS.Twitter:FormatUrls(text)" disable-output-escaping="yes"/>

    Cheers,
    Garry.

  • bob baty-barr 1180 posts 1294 karma points MVP
    Sep 08, 2011 @ 22:43
    bob baty-barr
    1

    is that line in a for-each? meaning that is teh text of a single tweet? if so... you can try something like this... replace 100 with however you want to shorten it.


        <xsl:variable name="twtTxt" select="CWS.Twitter:FormatUrls(text)"/>
        <xsl:variable name="shortText" select="umbraco.library:TruncateString($twtTxt, 100, '')" />
        <xsl:value-of select="concat($shortText, '...')" disable-output-escaping="yes"/>
            
       
  • Garry Bain 149 posts 124 karma points
    Sep 12, 2011 @ 16:33
    Garry Bain
    0

    Ohh excellent bob_baty-barr! Sorry I'm late in getting back - not the first time you've helped me out on here. Thanks so much.

    Garry.

  • bob baty-barr 1180 posts 1294 karma points MVP
    Sep 12, 2011 @ 16:59
    bob baty-barr
    0

    Glad it helped! ROCK ON!

Please Sign in or register to post replies

Write your reply to:

Draft