How to limit number of rows in Announcement body


  • Hey all once again,

    Thanks for understanding:) A simple question - how to show only two first rows of the body of announcements? There is a big need for that as we have many announcements every day...

    Thursday, December 04, 2008 2:30 PM


  • Displaying two rows is quite difficult to achieve as it has to do with how big the font is: what would be one row on one pc could be four rows on another. Limiting the length of the announcement would be a better requirement. You could always try to play with the settings a bit to get a string which would in general be about two rows long, that's as far as you can get.

    From your question I assume you mean a content aggregation. If you're using the Content Query Web Part you could easily do that in XSLT using the substring function, like:

    <xsl:value-of select="substring(@YourField, 0, 100)"/>

    Which would return the first 100 chars of your announcement.

    Thursday, December 04, 2008 3:40 PM