Sitecore GetIdFromConfig with unicode text

68 views Asked by At

I use Sitecore 7 and in the code I see this line

 public static ID HelpLinks
    {
        get { return GetIdFromConfig("aer.ProductDetails.HelpLinks"); }
    }

Developer define this line with this function

 static ID GetIdFromConfig(string key)
    {
        try
        {
            return new ID(Sitecore.Configuration.Settings.GetSetting(key));
        }
        catch (Exception ex)
        {
            Sitecore.Diagnostics.Log.Warn(String.Format("GetIdFromConfig (key='{0}'): not found ", key), ex, "aed.Classes.ConfigID");
            return null;
        }
    }

I wonder how it define the

aer.ProductDetails.HelpLinks

In order to get Sitecore unique ID and use it in other templates. is any one know how it define?

1

There are 1 answers

0
Adrian C. On

Somewhere in settings section in configs (either web.config or some include file from Include folder for your solution) you need to define that key with that name.

Should have something like this:

<sitecore>
  <settings>
    <setting name="aer.ProductDetails.HelpLinks" value="sitecoreID" />
  </settings>
</sitecore>

where sitecoreID is an Sitecore ID format like {DE3A698F-1D7F-4C43-B797-162C5811E270}