Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access sitecore settings programmatically (Sitecore 6)

Is there a way to get to sitecore settings through code.

The specific setting I'm interested in is the data Folder path.

like image 972
marto Avatar asked Mar 08 '10 09:03

marto


2 Answers

If you'd like to get other settings, you may want to try:-

Sitecore.Configuration.Settings.GetSetting("SettingName");

This will work for all sitecore settings, even your custom settings that can be added through the config files in the App_config/Include.

like image 186
Sean Holmesby Avatar answered Oct 20 '22 07:10

Sean Holmesby


Yes. Look at the Sitecore.Configuration.Settings class (which is your entry point to the Sitecore settings), and use the static DataFolder property:

string dataFolder = Sitecore.Configuration.Settings.DataFolder;
like image 22
driis Avatar answered Oct 20 '22 08:10

driis