Reputation: 2688
Is keyword metadata currently exposed in the model DD4T creates?
I can see a Keyword type can be retrieved via the TaxonomyFactory/TaxonomyProvider - but this only exposes basic properties of the keyword itself, Id, Title, ParentKeywords etc.
Do we have roll our own mechanism at the moment - extend the DD4T Keyword in ContentModel.cs and use our own provider perhaps?
Cheers
Upvotes: 2
Views: 801
Reputation: 3547
Keyword metadata is currently not exposed through DD4T. To be honest, it is not even very useful to do so. The essence of DD4T is to deserialize components and pages into a more useful object model than the one offered by the Tridion content broker. In the case of keywords, everything you would want to know about them is already in the broker database as metadata!
Besides, since keywords have no 'output', there is nothing to deserialize.
Code example (using the Tridion.ContentDelivery.Taxonomies namespace):
TaxonomyFactory tf = new TaxonomyFactory();
Keyword keyword = tf.GetTaxonomyKeyword("tcm:5-112233-1024");
Console.WriteLine(string.Format(
"found keyword with name {0}, key {1}, description {2} and custom metadata {3}",
keyword.KeywordName,
keyword.KeywordKey,
keyword.KeywordDescription,
keyword.KeywordMeta));
Upvotes: 3