Skip to content
NielsEllegaard edited this page Jun 8, 2014 · 1 revision

DictionaryItems

APE splits the Dictionary into two classes. Dictionary and DictionaryKeys. The Dictionary contains the values and the DictionaryKeys contains... Well the Dictionary Keys.

It is pretty simple so I will just show it:

DictionaryKeys

APE generates a class with all your DictionaryKeys. It looks like this:

namespace APE.Umbraco.App.Classes.Cms
{
   public static class DictionaryKeys
   {
      public const string ReadMore = "ReadMore";
      public const string ReadLess = "ReadLess";
      public const string Menu = "Menu";
   }
}

So getting the DictionaryKeys is very simple:

DictionaryKeys.ReadMore

Dictionary

Now APE makes it easy to extract the values aswell. Normally you have to go through the UmbracoHelper to get it. But APE cheats a little by making its own UmbracoHelper, parsing the DictionaryKey into it and returning the value. The class looks like this:

namespace APE.Umbraco.App.Classes.Cms
{
	public static class Dictionary
	{
		public static string ReadMore{ get { return UH.UmbracoHelper.GetDictionaryValue(DictionaryKeys.ReadMore); }}	
		public static string ReadLess{ get { return UH.UmbracoHelper.GetDictionaryValue(DictionaryKeys.ReadLess); }}	
		public static string Menu{ get { return UH.UmbracoHelper.GetDictionaryValue(DictionaryKeys.Menu); }}	
	}
}

So getting the values is just as simple as getting the keys:

Dictionary.ReadMore

Clone this wiki locally