API Questions on Kentico API.
Version 6.x > API > Get Settings View modes: 
User avatar
Member
Member
positivepurchasing - 5/4/2012 6:47:17 AM
   
Get Settings
Hi

How do I get settings?

For example how would I get the 'Default Alias Path' of the current site?

Cheers

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 5/4/2012 6:59:53 AM
   
RE:Get Settings
Hello.

You can use methods from CMS.SettingsProvider.SettingsKeyProvider class. For example GetKeyValueFromDB. Please see more details in API reference file.

Best Regards,
Radek Macalik

User avatar
Member
Member
positivepurchasing - 5/4/2012 7:31:18 AM
   
RE:Get Settings
Thanks for your quick reply.

However the API Reference file contains no descriptive text or examples.

CMS.SettingsProvider.SettingsKeyProvider.GetKeyValueFromDB(CurrentSite.SiteName, "DefaultAliasPath");

Can you give me some clues?

Cheers

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 5/4/2012 8:45:36 AM
   
RE:Get Settings
Hello.

According to my API reference file, it uses two parameters:

Site name (which is known, or can be taken from CMSContext class).
globalKeyName – you can see these values in CMS_SettingsKey table, in KeyName column.

Best Regards,
Radek Macalik