Navigation

Automatic Linking is Great When Making Links Automatically

When I explain Tridion dynamic linking, I sometimes get the "but I want to link to a specific page" response. See my post on how to understand dynamic linking from a manually-curated authoring view; otherwise read on to see how dynamic linking really shines when the links are created or otherwise generated automatically.

Here's a hypothetical scenario that I've worked through at an actual client with the team. In the end, we didn't need to implement this use case, but keep it in mind as an approach and example for dynamic linking.
  • The website has content that will be "tagged" with various topics (e.g. industries or interests)
  • These tags may apply to content on pages in different sections of the website
  • We want to display dynamically or generate a list of these topics such that each topic links to the content that matches in that section (let's assume one piece of content per topic, but this could be applied to many items)
How would you do this with Tridion?

The simple case of one dynamic display and a single set of content could be:
  • A Tridion Category called "Topic" lets CMS editors tag Components
  • Developers generate dynamic component links for the keywords so CMS editors don't have to do anything to get the list automatically aside from maybe placing a "widget" on a page (a Component Presentation that adds the server-side code for this functionality)
  • The widget would either generate the links on publish (template them) or pass the tag or control and parameters to the Web application (e.g. <somenamespace:tagorcontrolname topic="sometopic">)
  • Default delivery-side dynamic linking rules will resolve the links so that each Component + Component Template combination becomes a hyperlink on request
Now, what happens when you have another section in the website that uses the same topics, but with different destinations?

Options include:
  • Assume categories won't work. Manage these manually instead.
  • Use different Component Templates, so that one section resolves links to pages with its template. You might optionally use template priorities.
  • Leverage dynamic linking, by generating the Tridion Content Delivery Library (tcdl) tags or controls and letting dynamic linking proximity rules resolve these to the correct location.
With dynamic linking, you might have section-specific links for things like:
  • Help (with this topic, product, or section)
  • Support (for this department)
  • Map (for this region, as organized in structure groups)
Then using the proximity rules, if you don't have Structure Group specific pages for help, support, or the map, you would get the closest version. All you have to do is organize your pages from general at the higher levels to more detailed as you go into the Structure Groups. Based on what's published, when a visitor clicks on "Help," they'll the page for Help for that section (Structure Group), but if not available, they'll get a more general Help page. Based on parameters, the dynamic link could also disable the link and even hide the text if no pages are available with that content.

If making a manual link, from an editorial perspective you have to think in terms of "adding a link to my section's set of special pages." Just make sure these references are on your target pages as Component Presentations and maybe place them in a special "references" folder. But again, it's much better when it's automatic.

Anyways, knowing the proximity rules earned me a beer in Paris--use this knowledge to demonstrate your Tridion resolve at understanding Tridion resolving behavior (in delivery).

Oh and by the way, the dynamic linking proximity rules explain why Tridion cannot cache a dynamic link with an invalid page id. If you don't know where to start, how can you cache the destination for the next request?

No comments:

Post a Comment

Feel free to share your thoughts below.

Some HTML allowed including links such as: <a href="link">link text</a>.