0

I have an simple sharepoint website with some basic features, and one of them is Announcements which so far cause me many problems. However, I would like to know how is possible to limit the text in the announcement webpart which is on homepage, because right now is displaying the entire content.

I've done many research and tried in many ways but so far I couldn't find the solution.

Any help will be very appreciated!

Kind regards, Laurentiu

2 Answers 2

1

You can add a Content Query Web Part to the main page that gets its information from the Announcements list exclusively. The CQWP allows you to apply custom styles to how each result is displayed through XSLT.

Applying this line to a custom defined XSLT section will allow you to select only a limited amount of text from the announcement.

<xsl:value-of disable-output-escaping="yes" select="substring(@MyDesc,1,180)" />

In the settings for the CQWP you will be able to choose what column @MyDesc points to such as "Body" for the list.

    <xsl:template name="NewsAnnounStyle" match="Row[@Style='NewsAnnounStyle']" mode="itemstyle">
        <table>
            <tr>
                <td>
                    <table> 
                        <tr><td>
                            <xsl:variable name="SafeLinkUrl">
                                <xsl:call-template name="OuterTemplate.GetSafeLink">
                                    <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
                                </xsl:call-template>
                            </xsl:variable>
                            <h3><a href="{$SafeLinkUrl}"><xsl:value-of select="@MyTitle"/></a></h3>         
                        </td></tr>
                        <tr><td> <xsl:value-of disable-output-escaping="yes" select="substring(@MyDesc,1,180)" /></td></tr>
                        <tr>
                            <td> 

                            </td>
                        </tr>
                    </table>
                </td>
            </tr>           
        </table>
      </xsl:template>

This would be a generic layout for the style for an announcements list that I've used before.

0

You can modify the display of the announcement webpart by modifying the webpart properties. Edit the webpart. In the "List Views" section you can change the view and toolbar settings to display more or less text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.