Search code examples
tridiontridion-2011tridion-content-delivery

What is the simplest way to override namespace in <tridion:ComponentLink/>


For my ASP.Net-based Tridion2011-powered site i need to replace standard generated <tridion:ComponentLink/> with some <custom:ComponentLink/>.

(Let's assume this custom control's semantics is the same, that is: only need to replace namespace part.)

What will be the simplest and least intrusive way to do this?

My guess is that i should implement an alternative to standard LinkTagHandler. Is it correct?

The only [infinitesimal] downside of this solution is that it will require explicitly configuring all tag handlers in cd_deployer_conf.

EDIT

Found a dumb simple solution to the very specific task of aliasing namespace only:

<TCDLEngine>
    <Properties>
        <Property Name="aspnet.tagprefix" Value="custom"/>
    </Properties>
</TCDLEngine>

By a lucky chance all my <tcdl:../> tags got mapped to <custom:../>, otherwise, this little cheat not gonna work.

Overall, i'm rather in favor of Peter's and Nuno's suggestions of creating custom TCDL tag handler..

(Just need to win over my laziness:-).

EDIT 2

Oops, just noticed, that Nuno suggests exactly the above!


Solution

  • You can easily control the prefix by changing it in the cd_deployer_conf (in the TCDLEngine element).

    Obviously, you'll need to take care of implementing the control/tag handler for that prefix, and republish every page/dcp that should use it.