4

I'd like to implement label as dynamic component presentation. (I mean "label" as text which is used in whole WEB site, like "see more" on link button.) And I want to use TCDL tag, because it works both of .NET and Java enviroment.

I created a schema which has only one text field, and input label text on a component which is based on the schema. Then I created a dynamic component template which output the label text. On component template DWT, I write tcdl:ComponentPresentation tag to output label, then it works fine.

But problem occurs when using dynamic linking(component link). To implement dynamic linking, I write tcdl:Link tag, and tcdl:ComponentPresentation tag inside of it to output label text. But label is not displayed on WEB page, because tridion:ComponentPresentation tag is in LinkText attribute of tridion:ComponentLink tag as text on published ASPX page.

DWT:

<tcdl:Link type="Component" origin="tcm:0-0-0" destination="@@LinkedComponentID@@" templateURI="tcm:0-0-0">
<tcdl:ComponentPresentation type="Dynamic" PageURI="@@PageID@@" ComponentURI="@@LabelComponentID@@" TemplateURI="@@LabelComponentTemplateID@@" />
</tcdl:Link>

Published ASPX page:

<tridion:ComponentLink runat="server" PageURI="tcm:0-0-0" ComponentURI="tcm:21-556" TemplateURI="tcm:0-0-0" AddAnchor="false" 
LinkText="&lt;tridion:ComponentPresentation runat=&#34;server&#34; PageURI=&#34;tcm:21-1136-64&#34; ComponentURI=&#34;tcm:21-1083&#34; TemplateURI=&#34;tcm:21-1082-32&#34;/&gt;" /> 

I want to output following code on published ASPX page.

<tridion:ComponentLink runat="server" PageURI="tcm:0-0-0" ComponentURI="tcm:21-556" TemplateURI="tcm:0-0-0" AddAnchor="false" >
<tridion:ComponentPresentation runat="server" PageURI="tcm:21-1136-64" ComponentURI="tcm:21-1083" TemplateURI="tcm:21-1082-32"/>
</tridion:ComponentLink>

Is it possible to use tcdl:ComponentPresentation tag inside of tcdl:Link tag?

6

It appears the Deployer does not resolve tcdl tags inside out, which means it does not support nested tags unfortunately.

However when looking at your construct I would say that is sounds rather expensive to use a Dynamic Component Presentation, just for a single label value.

I would personally create a labels Component and publish that as a resource bundle with a set of key, value pairs. Then create something in your ASPX page to read that label from the resource bundle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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