Add Comment to announcements (1)

Source: Internet
Author: User

A website created by using a Sharepoint site template, such as a team site, contains the announcement (Announcement) function. By default, users cannot comment on announcement items. In fact, it is the same for all the custom lists created by default, and there is no way to add comment. So in some scenarios where user comment is required, it is depressing.

Fortunately, there is a blog website template in the site template. The site created through it contains the blog and the function of posting comments to the blog. Look at the structure of the blog and find:

    • The blog function consists of two lists: posts and comments.
    • The two lists use the lookup field post id (this is a hidden field, and I do not know how to generate it. The list setting page cannot be seen, and the SharePoint object mode must be used for editing.CodeView) post title is connected, and the blog and the corresponding comment are displayed on the page through the view written by caml.

Then there is a way to add a comment to announcement:

1. Create a list to store comments, such as announcement comments.

2. Add fields to the comment list:

    • Nickname-single line of text
    • Body-multiple lines of text
    • Post ID-Lookup(This field is required and connected to announcements-> ID)

3. Use designer to open displayform. aspx of announcements. In general, all comments should be listed in the announcement text, and a tool for adding new comments should be provided at the bottom. Now there are two parts in the body. here we need to add two new Web parts, one for displaying all comments, and the other for adding new comments.

4. For simplicity, we add two new webparts on the page (so we don't have to generate the webpart ID on our own) and then modify the two webparts. The actual operation is as follows:

    • Open an announcement and addDisplaymode = DesignFor example, http: // localhost: Port // lists/announcements/dispform. aspx? Id = 8 & source = XXXXX &Displaymode = Design

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.