Question

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!

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Of course, you don't need to use TCDL at all. Simply emit the required code directly from your template. The only time you'd need to use TCDL for this is if you have a hard requirement to generically target multiple front-end platforms.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top