Question

In addition to a name, key, value, and relationships to other keywords, a keyword itself can have metadata. This allows the author to add additional information by selecting a metadata schema to then add whatever:

  • text
  • selections (text with options or a Category)
  • links
  • etc

SDL Tridion Keyword Metadata

SDL Live Content describes how to retrieve Keyword properties. Given a keyword, myKeyword, we can get myKeyword.KeywordMeta.NameValues as name-value pairs (dictionary).

I can see the use case would be in presentation server-side code, .NET or Java developers could get additional information for a given keyword.

I understand keywords as an option to categorize components and provide options for authors to select in other fields. In most cases where I'd want fields, I'd suggest a component, but want to make sure I understand how we should use keyword metadata and any programmatic restrictions.

  • For SDL Translation Manager, would keyword metadata be translatable? It looks like keywords themselves are translatable as part of a Category (and individual keywords depending on your version*). We can of course localize keywords without Translation Manager.
  • Does keyword metadata apply in the Content Manager? Would you use this in C# TBB's for example?

Update for others wondering: Be sure to check your version of SDL Tridion and SDL Translation Manager -- Lars pointed out that SDL Translation Manager version 3.0 does have single keyword translation ability. Chris noted behavior in GA. When in doubt, check the docs or confirm in your setup.

Was it helpful?

Solution 3

With regards to metadata I always consider it as "data about data", hence I wouldn't use it directly for content purposes, the only exception to this for me is metadata on a multimedia component (since you don't have regular content fields there). But then looking at keywords I think this could at some point be the other exception to my rule.

If you build up your navigation based on keywords, there is a use case for additional data, including (translatable) content. The metadata of keywords is translatable through translation manager, but it is not sent forward to the broker if I recall correctly. So to use it, you would have to store it as a sitemap page for instance (writing the keyword metadata through a template/C# TBB in a page).

OTHER TIPS

You might consider using keyword metadata when building taxonomy driven navigation. In the past I have added values for paths and other data to be added to the site for SEO purposes, and even tried adding links to MM components to use as background images and buttons on the rendered web pages. However in Tridion 2011 GA binary data did not get published to the Broker, so I needed a different solution. This may have been fixed in later releases, but I have not tried recently.

If you use Tridion 2011 SP1 (which includes Translation Manager 3.0) you can translate individual keywords - not just the entire category.

You can also translate keyword metadata - this might also be possible in previous versions of Translation Manager (in case you are on Tridion 2011 GA) but I can't remember for sure. It's not listed as a new feature of 3.0 which suggest it was possible before... but it could of course also have been left out of the new feature list by mistake. :)

I am just working on a project in which we use the keyword Metadata extensively. It's a bit of getting used to for the content managers, since you are moving content into little bits which were in the early days of Tridion only trivial for categorizing certain content.

However, we use it for the display of dynamic contact details for different departments and groups displayed throughout the website. And for some other site-wide use of text, images and links to content categorized with these keywords.

A republish of the category and the whole site has updated, correct(ed) and textually equal content.

I used the keywords for this instead of dynamic components, because it seemed like the best way to use on dynamic content, which had to be classified anyway. This way even when published a year ago, all reference information about other classifications on this dynamic item would always stay up-to-date.

By the way, this solution is with Tridion 2009 SP1 and Java.

I have always loved the broker and taxonomy ;-)

Yes, i have used C# TBB for access value from the Keyword metadata field.

First you have to use a parameter schema to pass the category name to C# TBB and then

Second you have to access the category by below code

 Publication publication = GetPublication();

            TcmUri uri = new TcmUri(int.Parse(_itemId), ItemType.Category, publication.Id.ItemId);
            _session = engine.GetSession();
            Category cat = new Category(uri, _session);

            Log.Debug("the uri is " + uri);
            Log.Debug("the cat is " + cat);

            Filter filter = new Filter();
            //filter.Conditions["IsRoot"] = true; // This works with Tridion 2011 only!

            List<Keyword> keys = cat.GetKeywords(filter) as List<Keyword>; 

Last, after accessing the Keys you have to loop on Keys and get Metadata field like below

ItemFields fields = new ItemFields(key.Metadata, key.MetadataSchema);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top