5

I want to attach a query string using the SDL Tridion syntax Component link resolver below. Is there a specific attribute that I can use?

I need to resolve the link in a TBB before it gets published to Broker.

<a href="#" tridion:href="@@Component.ID@@">@@Component.Name@@</a>
1
  • 1
    Unfortunately, not using the standard OOTB. It is a surprise when we first realized (obvious for WCM) but as others suggested you could try alternatives or write your own Link control tag.
    – Kaylan
    Commented Jul 29, 2013 at 18:41

1 Answer 1

6

A Component link is resolved at request time, since that is the only moment when the correct link can be shown (it could be that the item you are linking to is moved to another Page or unpublished, after this Page has been published). So in your Template code there is nothing you can do, nor is there a tridion: attribute that you can use to add a query string to resolved URL.

The Template code basically renders as a TCDL tag:

<tcdl:Link type="Component" origin="tcm:1-34-64" destination="tcm:1-23" 
           templateURI="tcm:0-0-0" linkAttributes="" 
           textOnFail="false" addAnchor="False">something</tcdl:Link>

This is transformed by the Deployer into a control (ASP.NET Custom control or JSP tag depending on the language of your website).

<tridion:ComponentLink runat="server" ComponentURI="tcm:1-23" LinkText="something" 
                       LinkAttributes="" 
                       PageURI="tcm:1-34-64" TemplateURI="tcm:0-0-0" 
                       AddAnchor="false" TextOnFail="false" />

So the only option you have is to create a custom TCDL tag (link requires login) which will call the link resolver and allow you to add a query string to its result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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