Using document libraries in Sharepoint to expand news applications (references)

Source: Internet
Author: User

Address: http://www.winu.cn/space-14160-do-blog-id-25923.html

After "using a document library to expand news applications in SharePoint" was issued, many friends received a lot of feedback. This article is intended to inspire others and propose a way to solve the problem, in practical applications, you need to use it flexibly according to the actual situation and needs.
In Article For saving news content, XML is used. However, there are also many disadvantages. For example, the XML file is obtained after the original search. To view the content correctly, you must develop the search. There are many other inconveniences.
Another way to solve this problem is to use a template to save the content directly to the template. Here is a simple example:
First, create a document library to express the classification and layers of the content using the folder and its hierarchy of the document library.
Second, create a content page as a template according to the style of the entire site, and mark it on it, such as <$ title $ >,< $ content $>, these marks indicate the title, author, page views, and body content of the article.
Third, use the editor to create an article.
Fourth, save. When saving, use web. getfileasstring: Get the template string in step 2, replace the tag with the corresponding content, convert the string to byte [], and use folder. files. add to a folder. Note that the saved format must be the same as that of the template, as shown in. aspx or static page. The title, creator, and other content of the document are saved as attributes of the file as a field.
Here, another problem occurs: How can I edit it after saving it? How to display the page views?
The edited question after saving. When creating a template, you can mark the content at the beginning and end. When editing the content, first obtain the string of the file and then search for the start and end tags, then, the content in the intercept is the body, and other headers are taken in the field.
Page views. The difficulty of this problem is that it changes dynamically and cannot be fixed as the text. However, there are also many solutions. The most common method in SPS is to reference controls or Web Components. If the storage format is ASPX page, you can write a usercontrol, then retrieve, display, and update the page views from it. As for the control reference method, you can copy the ascx file to the controltemplates directory of the SPS control, mark it on the page according to the reference method of SPs.
To use this method, you also need to examine performance, security, and other aspects.
Is the page of our recent project:

In this project, we use a similar method for news content, and integrate multiple business systems and single sign-on. Each area block on the page is deployed as a Web part.
time relationship. Please write so much first.

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.