Here is what you can put in the CustomMacroMethods.cs file
Put this in the RegisterMethods() Block:
MacroMethods.RegisterMethod("GetSiteSetting", GetSiteSetting, typeof(string), "returns value of site setting with specified setting key", null, 1, new object[,] { { "type", typeof(string), "The settings key name. " }, { "siteName", typeof(string), "The site name. If this parameter is omitted, the value of CMSContext.CurrentSiteName will be used" } }, null);
add these methods to the class
public static string GetSiteSetting(string settingKey, string siteName)
{
return SettingsKeyProvider.GetStringValue(String.Format("{0}.{1}", siteName, settingKey));
}
public static object GetSiteSetting(params object[] parameters)
{
switch (parameters.Length)
{
case 1:
return GetSiteSetting(ValidationHelper.GetString(parameters[0], String.Empty), CMSContext.CurrentSiteName);
case 2:
return GetSiteSetting(ValidationHelper.GetString(parameters[0], String.Empty), ValidationHelper.GetString(parameters[1], String.Empty));
default:
break;
}
return null;
}