I know how to fetch Keyword metadata using Tridion Content Delivery and how to loop through Metadata fields, but i am not able to loop through if they have multivalued meta fields.
I have notifications
as multivalued RTF field as metadata of some Keyword and I am trying to read it and assign it to some custom class property. But as it is multivalue, I am not able to loop through it and convert it to List<MvcHtmlString>
public class SyllabusTemplateMeta
{
public List<System.Web.Mvc.MvcHtmlString> Notification { get; set; }
}
SyllabusTemplateMeta syllabusMeta = new SyllabusTemplateMeta();
TaxonomyFactory taxonomyFactory = new TaxonomyFactory();
var keywordMeta =taxonomyFactory.GetTaxonomyKeyword(keywordId).KeywordMeta;
IDictionary mnd = keywordMeta.NameValues;
IEnumerator mne = mnd.GetEnumerator();
if (mne != null)
{
while (mne.MoveNext())
{
DictionaryEntry de = (DictionaryEntry)mne.Current;
NameValuePair currentMeta = (NameValuePair)de.Value;
if (currentMeta != null)
{
if (currentMeta.Name.ToLower() == "notifications")
{
syllabusMeta.notification= new System.Web.Mvc.MvcHtmlString(currentMeta.Value.ToString());;
}
}
}
}