0

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?

Jan Bluemink
  • 3,467
  • 1
  • 21
  • 35
sohrab
  • 38
  • 2
  • 1
    Do you ask StackOverflow to ready this code for you and tell you what it does? – Marek Musielak Feb 18 '16 at 15:45
  • No I just want to know how define the unicode text like aer.ProductDetails.HelpLinks in sitecore – sohrab Feb 18 '16 at 16:57
  • What do you want achieve exactly? It's hard to understand your question – Vlad Iobagiu Feb 18 '16 at 17:23
  • in this code public static ID HelpLinks { get { return GetIdFromConfig("aer.ProductDetails.HelpLinks"); } } how the developer define aer.ProductDetails.HelpLinks that get page uniqe ID. – sohrab Feb 18 '16 at 17:38
  • aer.ProductDetails.HelpLinks thats give uniqe ID of page like that {4CDB8F14-8D48-4A6E-B334-6D6C58C9C821} and then I use it. – sohrab Feb 18 '16 at 17:40
  • I found the solution I need to define in in idsetting.config and then use it – sohrab Feb 18 '16 at 17:55

1 Answers1

1

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}

jammykam
  • 16,940
  • 2
  • 36
  • 71
Adrian C.
  • 231
  • 1
  • 7