Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9193161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:05:43+00:00 2026-06-17T21:05:43+00:00

We often need specific items (schemas, templates, or components) in Tridion-related code. Template, Content

  • 0

We often need specific items (schemas, templates, or components) in Tridion-related code. Template, Content Delivery, Workflow, or the Business Connector (Core Service) regularly need references to Tridion Content Manager URIs. We can link to components, but I typically see either hard-coded values or WebDAV URLs for everything else.

Hard-coded values

I understand hard-coding Tridion Content Manager (Native) URI’s is a bad practice except for a few scenarios:

  • To simplify example code and make it clear what a variable is
  • When generated for use in Content Delivery (CD) API logic

Whenever possible we use the given API or WebDAV URLs to reference items, otherwise we must avoid using Content Porter on anything that references TCM URIs (or somehow make these references “configurable” outside of Tridion).

WebDAV URLs

WebDAV URLs seem to be better for a few reasons:

  • Hard-coded values in design template building blocks (TBBs) or other template formats remain intact with SDL Content Porter (breaking a relationship when moved through CMS environments, with an exception described below)
  • “Configuration” components that refer to specific items also do better with SDL Content Porter, though differently-named paths can “break” relationships

Use cases

In addition to having template that work well with Content Porter, I would like to localize folders and/or structure groups in lower publications. This can help with:

  • CMS authors that read different languages
  • translate item names and paths to appropriate languages
  • maybe help users navigate better (e.g. I suspect different-named folders may reduce confusion for where authors are in the BluePrint)

One Approach

To make references “Content Porter-friendly,” at least for Template Building Blocks, I know we can use WebDAV Urls in components making sure to localize each path to the right locations in children publications. For example:

  1. Code checks Publication Metadata
  2. Publication Metadata points to a “config component”
  3. Config component has paths as WebDAV URLs

As long as we set the Publication Metadata and localize the fields to the correct paths per publication, this will work for most scenarios.

Questions

  • Did I get this right? Is there a simpler or easier-to-maintain setup?

I believe we can alternatively use includes or map unmanaged URI in template code.

  • Anyone have an example of the #include approach? Do I use that at the top of a TBB and/or DWT and do references get replaced regardless of Template Mediator (e.g. will this work with XSLT Mediator, Razor Mediator, etc?)

  • Does the included reference work in lower publications or is this just for Content Porter? In other words, if I reference “tcm:5-123” will the template correctly reference “tcm:17-123” in publication 17?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:05:44+00:00Added an answer on June 17, 2026 at 9:05 pm

    I tend to follow a few simple rules…

    1. There is no single valid reason to ever use a TCM ID in anything – template code, configuration components, configuration files.
    2. If I need webdav URLs in configuration, I try to always make them “relative”, usually starting at “/Building%20Blocks” instead of the publication name. At runtime I can use Publication.WebDavUrl or PublicationData.LocationInfo.WebDavUrl to get the rest of the URL
    3. Tridion knows what to do with managed links, so as much as possible, use them. (managed links are the xlink:href stuff you see a bit all over Tridion XML).

    I also tend to use a “configuration page” for content delivery, with a template that outputs the TCM IDs I may need to “know” from the content delivery application. This is then either loaded at run time as a set of configuration variables or as dictionary or as a set of constants (I guess it depends how I’m feeling that day).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I often need to list items with various-sized images on the left and text
Often when I'm designing a site, I have a need for a specific style
I often need to use a function which performs and action X is condition
I often need relatively small (<10000 entries <1kb) caches for speeding up calculations. My
I often need to fetch tgz files, decompress them, and then delete the tgz.
I often need to remove lists of columns from a data.frame. I usually do
When programming for the iPhone, I find that I often need to use the
Pretty often I need to access $config variables in views. I know I can
Im designing a website, and often I need to present information in a nice
Unfortunately, I often find I need to reboot to wipe some unhealthy Xcode state.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.