Create a dynamic and more user self service Web Portal

I have been worked on a CMS Portal project in SharePoint 2013 platform and needed to create a lots of forms and landing pages. The stake holder needed to review and change frequently of the heading, messages, and column headers on the application pages, and so I am thinking to separate the labeling / contents from the code which the similar approach as Sitecore to save and retrieve word values in model's fields and then loading them to front-end pages.

SharePoint provides some features to achieve showing dynamic contents as below methods:

1. Using SharePoint List
I used a SharePoint list to save Label and message text values and then loading them dynamically in SharePoint WebParts.

The benefit of this approach is giving user to update label/contents more easier without updating the source code. It increases the work efficiency. In some case, there will be multiple site collection needs to share data from the same SharePoint list. This causes cross domain call issue in jQuery (if using SharePoint client side script) in IE browser, and so I suggest to create multiple lists in each site collection, and then develop and implement a custom feature to replicate the list item from a major list to other ("dual") lists when there are changes in the major list in the home site collection.

Actually, SharePoint list gives you more control on showing contents in a landing page.

Case 1
I was requested to develop / update a Admin landing page to display different groups of Links (URL) for different user roles based on user's login credential. The existing code hard code the text and links on there, and so it looks hard and difficulty to maintenance, plus not easy to change the text and links if request as need to change and deploy the code again,

So I used SharePoint list to control showing / hiding pages links based on user roles in WebPart. Below is the screenshot of the list I worked on.









Note: above approach is suitable for label, column header and message which don't need to save back to Database. For core value, it's better to retrieve and save in the Database.

2. Using JSON file
This is the latest approach which craft a .json file to save label, messages and page title in SharePoint document library, and then I retrieve contents from this file and showing them page programmatically. The benefit is people can easy change words in this file which same as SharePoint List but would be more efficient and save SharePoint space.  

Case 1
I need to develop a survey for different group with different questions. In this case, I use a txt file to save the list of survey questions for each group, and then loading the related file when the certain group user is login in to the Web site. I also built a report to show survey result and it shared the same question file as the survey page.

Below is the screenshot of the question file and the document library for these files.

A screnshot of the dynamic survey report.


3. Using Database
This way is similar to above approach.The drawback is not easy for end user (Stake holder) to update contents and only developer can change.  

In conclusion, separate the label and code is a effective and flexible way to build a dynamic portal site, and I can concentrate on the code quality and found out the program is cleaning and easy understand compare with the one with hard code text inside.  


Comments

Popular posts from this blog

Top JavaScript courses helping you develop SPFx webPart with ReactJS and AngularJS

Effective LLM Prompting skills

Enable the Microsoft Power BI report file type (.pbix) in SharePoint Search