I would like to add some custom settings for websites which I want to manage in website management. Is this possible?
You can refer to this article-
Or another way to create an admin controller and use DDS to store anything that you want and retrieve them based on your need.
What code are you calling that doesn't have the ability to access the ContentLoader data? You should normally be able to access items directly by code even in things like Initialization Modules or startup files. Often the CotentReference.StartPage isn't set but you can pull the startpage from the SiteDefinition repository
Thanks for all the replies. Ravindra S. Rathore Thanks for the article link. It is interesting way of injecting SiteSeetings from StartPage. But, it doesn't solve my issue. The issue found to be constructor injection of a service in ActionFilter that I am using to call an API. This action filter was initialized by GlobalFilters.Filters.Add. It is too early in the MVC pipeline and StartPage was not built yet. Once I removed service initialization from contructor, I could read settings using following code.
var contentLoader = ServiceLocator.Current.GetInstance<EPiServer.IContentLoader>();var siteSettings = contentLoader.Get<StartPage>(SiteDefinition.Current.StartPage, LanguageSelector.AutoDetect());
Episerver Foundation uses content as settings. Example of the implementation can be found here: https://github.com/episerver/Foundation/tree/develop/src/Foundation/Features/Settings and here: https://github.com/episerver/Foundation/tree/develop/src/Foundation.Cms/Settings