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.