Creating dynamic labels within SDL Tridion content


Whilst the above implementation provides a workable answer to the business requirement.  We did run into a minor problem once the solution had gone live as the business users asked ‘How do i know which components use a specific dynamic variable?’

The content variable ($$keyword$$) is injected directly into the rich-text content, the Keyword isn’t getting associated to the content component.

To support this (thanks to a bit of coaching from the SDL Tridion MVP group on Skype) a solution / improvement is possible using the SDL Tridion event system on-component-save event.

  • First, parse the content and evaluate if any $$keyword$$ values are present.
  • Search the keywords for the relevant / associated keywords
  • Classify the component with all associated keywords.

As always I’d be very interested to know of any other possible solutions to this problem or discuss this solution to thrash out some improvements.

3 thoughts on “Creating dynamic labels within SDL Tridion content

  1. Nice! The biggest gotchas I see when making extensions is that users expect all the Tridion functionality to apply. Where Used should work, but also BluePrinting and localization, Content Port between systems, the security model (users are not admins), and especially item changes need to work going forward.

    Using Tridion’s keywords lets us update their display names and you have a way to make Where Used work. You can even localize these if needed. The customer should be careful with changing the inserted values, but I’m sure you’ll have a follow up post when they ask to change $$some_value$$ to $$some_new_value$$ everywhere. :-)

    Minor point: I’d consider swapping key and description, but otherwise looks great. Where can we show you some love on StackOverflow?

  2. @Alvin – You can show me some love by going and upvoting everything i ever did on SO :)

    In terms of a user localising / changing this information you’re right. It would probably have been better to use a keyword key as this can’t be changed, but thebusiness users wish to have this localisation flexibility. They are a good team though, so i’m not too worried here :)

  3. Very Nice. Thanks.
    I’m interested in how can this be extended to display different labels according to visitor’s context (claims in ADF). e.g.: visitors from UK will see price in pounds (£).
    I’m not that familiar with SmartTarget but it does not seem to easily fit since SmartTarget uses Regions as placeholders for content and I don’t think it is feasible to embed regions within a rich text field.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>