Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 535
esteewhy Avatar asked Nov 27 '12 09:11

esteewhy


2 Answers

Yes, I recommend creating your own TCDL tag handler to output your custom control instead of the default. There's another potential downside, though: you'll need to republish your Pages / Components for it to take effect.

like image 65
Peter Kjaer Avatar answered Nov 20 '22 09:11

Peter Kjaer


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.

like image 24
Nuno Linhares Avatar answered Nov 20 '22 09:11

Nuno Linhares