One big "Hi" for all humans from planet Tridion :).
I am trying to make component links editable in SDL Tridion UI 2012.
I have one component that contains multi-valued component links as one of fields.
When I put following in DWT
<!-- TemplateBeginRepeat name="componentLink" -->
<!-- TemplateBeginIf cond="TemplateRepeatIndex<3" -->
<li>
<a href="#" tridion:href="@@RenderComponentField(FieldPath+"componentLink",TemplateRepeatIndex)@@">
Link${TemplateRepeatIndex}
</a>
</li>
<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->
Inside Template Builder as a result I got following:
<li><a href="#" tridion:href="<tcdl:ComponentField name="componentLink" index="0">tcm:8-625</tcdl:ComponentField>">Link0</a></li>
<li><a href="#" tridion:href="<tcdl:ComponentField name="componentLink" index="1">tcm:8-626</tcdl:ComponentField>">Link1</a></li>
<li><a href="#" tridion:href="<tcdl:ComponentField name="componentLink" index="2">tcm:8-627</tcdl:ComponentField>">Link2</a></li>
As expected an error occured on "Default Finish Actions" on a page level
Unable to find proper value for tridion:href
Is it needed to extract component links inside C# TBB in some previous action or exist any other way to resolve this( Enabling component links for SDL Tridion UI)?
In my "new UI VM" I have the following code in a design:
<tcdl:ComponentField name="LinkText">
<a tridion:href="@@Component.Fields.Target@@">${LinkText}</a>
</tcdl:ComponentField>
The linked Component is editable in the new UI. The tcdl:ComponentField is processed to wrap the appropriate in-context editing instructions around the link. You should be able translate that on to your code pretty easily...
Thank you Jeremy, manually adding <tcdl:ComponentField>
tag resolve this issue.
Here is final code that correctly resolve component links on a page level:
<!-- TemplateBeginRepeat name="componentLink" -->
<!-- TemplateBeginIf cond="TemplateRepeatIndex<3" -->
<li>
<tcdl:ComponentField name="componentLink">
<a tridion:href="@@Field@@">Link${TemplateRepeatIndex} </a>
</tcdl:ComponentField>
</li>
<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With