This article introduces a design concept for Sharepoint Publishing Web pages.
In a recent project, we encountered such a requirement. We need to control and automate the publishing experience of job-related information on an Internet-oriented SharePoint website. The purpose of automating this process is to ensure a uniform format, control the navigation design, and facilitate the use of pre-defined webpart templates.
To this end, we began to design a Sharepoint list to capture and organize the content required to create each web page of the website. The list includes multiple single-line text and rich text fields, and metadata fields used to select a suitable custom webpart from the library. Once the list item is saved, the Visual Studio 2008 workflow automatically completes the rest of the work.
The brief content of Visual Studio workflow operations is as follows:
1. Check whether the webpage has a duplicate name.
2. Duplicate web pages will be checked out and all webparts on them will be deleted.
3. Create a page, use a custom page layout, and name it.
4. Build the page header information and insert it into a web part on the page.
5. The content entered by the user is inserted to the page through the Visual Studio template.
6. pre-formatted webpart templates and custom partial attributes are automatically selected based on the list item metadata.
7. Release the new/Edit page as the primary version.
8. Point the link in the navigation to the correct folder and set it to hidden.
The first step of a workflow is to check the existing webpage in the page library to see if the same name exists. If you find that the webpage is checked out, all Web parts on the page are deleted. If no job name is found, the workflow selects a custom Layout corresponding to "job" and creates a new page. The page name is "job ID" and "job.
In the next step/CodeConnect to the HTML part pre-formatted and inserted into the Content Editor webpart to build the header. This webpart is inserted to the header area in sequence. The HTML part contains a dynamically generated button bound to an updated query string. the position and quantity information can be automatically transferred to the position application form. The subject content is filled in by the user using the built-in Rich Text Field. This content is laid out using the template specified in the Visual Studio 2008 workflow, then inserted into another Content Editor webpart, and finally added to its corresponding page area.
Click to view the chart
By specifying metadata for the list items, the workflow can select two from 48 pre-formatted custom webpart templates in the webpart library and insert them to the right area of the page. After this step is completed, the workflow check is completed, and the page will be automatically migrated to and released as the main version.
Finally, Sharepoint websites use very specific navigation requirements, including highlighting labels for all pages in the top navigation bar, or controlling the display and hiding of the left navigation bar based on the page type. When you navigate to a recruitment advertisement page, the "Occupation" in the top navigation bar and the "currently open" in the left navigation bar are highlighted, however, the link of the webpage should not be displayed in the current navigation. To solve this problem, the workflow selects a new page in the left-side Navigation Pane and moves it to the title of the currently open topic. Then, it changes the status of the new page to hidden.
In addition, when the Web Publisher changes the status of the list items from the job list to non-active, the workflow automatically deletes the corresponding recruitment page. Elsewhere, the website uses the data view to control the upper-layer display of job information based on functional requirements and the metadata of corresponding list items.
Automatic Processing of SharePoint page publishing through Visual Studio 2008 can greatly reduce the time required to publish webpages and improve design consistency, because users no longer need to manually select the Content Editor webpart and create content.
References
publishing
SharePoint web pages using Visual Studio workflows