Question

I have been asked to modify our project portal site to include the project name on each page at the top (we have about 25 pages in the site and we don't want the administrator to have to manually add the values on each page).

We have a "Project Setting" list that includes the ProjectCode, Project Name, and Project Description. There is only one row in this list as each project will get their own "list."

What we would like is to add the "Project Name" information to the top of each of our pages (right now we have content editor web parts with hard-coded text).

For example, what we would like is to have "Project Name - dynamically created based on the project setting list" then the #Page Name# (hard-coded) - for example "Top 10 Project - Calendar". We want to "template" the site and the hard-coded part of the pages will never have to be renamed.

I have read that this is "possible" using JavaScript and have tried to figure that out (with not much luck).

Was it helpful?

Solution

First thing I want to mention here is the use of list for just 1 item. This is not the way to go. You can use site properties (property bag values) to manage this situation. You can create 3 properties and update values to it. It will save storage and improve performances.

You can find in this article how to query property bag values using JavaScript CSOM and add them to master page. If the requirement is not the master page, you can use the same code in the page layout too.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top