8

Does DD4T include a way to look-up Tridion Content Manager (tcm) URIs by item name or WebDAV?

The use case is for referencing a given Category or Component Template without hard-coding CMS identifiers in delivery-side code. I'd prefer no TCM URIs in the CMS either, so nothing needs to be content ported between DTAP environments.

If not, how do I request such a feature or have my client submit this functionality to the DD4T community?

  • What do you mean by hard - coding. – Dominic Cronin Aug 8 '15 at 17:51
  • By hard-coding, I mean a TCM URI such as tcm:20-123-64 or tcm:20-456-32 in delivery-side code or in a (key-value "label" type) field in the CMS. These might be used to look-up pages, render content, or filter by keywords in delivery-side code. – Alvin Reyes Aug 10 '15 at 12:00
2

As usual, your mileage may vary. Irrelevant of DD4T - I think this question is important for any type of implementation - there are times when having a TCM URI on the delivery side makes your life easier - and hard-coding it is always a bad idea.

In my past life I used to have one "settings" page, where I would publish the URIs to the items I would possibly need - Schema IDs, Category IDs, that type of stuff (mappings for language publications?). In the CM I would store these values in a component as WebDAV URLs, so it can be ported to other environments, and in my template I would simply resolve the URL and publish the contextually-relevant URI. Simple, clean-ish, and portable.

Some of this can be done entirely on CD nowadays, with ItemTitleCriteria for instance, which could be used to find a schema, a Publication or a template by title. Just make sure you cache the results, you don't want to fire off this query every time you need to find a URI.

  • I'm debating between a WebDAV-based approach or simply generating identifiers for all Templates and Categories (akin to generating navigation CM-side). If we had this kind of "look-up" feature in DXA, would you (or anyone else) prefer a CM TBB or CD criteria approach? – Alvin Reyes Aug 10 '15 at 15:04
  • We have similar issues in DXA, there we indeed publish mappings files which contain the TCM URIs (sometimes only item IDs), so that you can safely use these in your web application. But the problem remains that when you want to create a link to an item on the CM site, as we still don't have item link fields in our Schemas (only Components). That is an enhancement request I have open for at least 10 years already on the CM Core... – Bart Koopman Aug 11 '15 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.