Reputation: 3486
In Tridion 2011 ( with UI 2012) I have a component with a field that is a list of Component Links. I'd like to enable inline editing on one of the fields that is being brought in via the Component Link. Is this possible?
I was able to enable inline editing for other non-Component Link fields, but the CL's seem to be an issue. I first tried the tcdl syntax, but that did not generate working SiteEdit Component Field markup. Finally I tried to edit the Start Component Field comment on the page to see if I could find a working syntax, but didn't come up with anything that worked.
Any ideas?
Upvotes: 3
Views: 404
Reputation: 3409
If you render this linked component using @@RenderComponentPresentation(componentTcmId, comonentTemplateId)@@
then the Enable Inline Editing for Components TBB will add the proper UI tags and you'll be able to edit your nested component.
The approach you've tried to render the Inline Editing commands manually should work. I suspect that the reason it did not work for you is because of some syntax error or invalid/missing parameter values.
If you share your entire rendered HTML document we may be able to help further.
Upvotes: 4
Reputation: 599176
Nick's solution calling RenderComponentPresentation
on your linked Components should work fine. Calling RenderComponentPresentations
for linked Components should in general be considered a good practice, since you are after all rendering another Component Presentation.
But if you want to take control over the exact tags that are generated, you can do that too. When I needed that level of control, I created some custom functions that output the comments directly instead of fiddling with tcdl
.
A DWT snippet that uses these functions:
<div class="ContentArea">
<div class="ContentFull">
@@MarkComponentPresentation()@@
<h1>@@MarkComponentField('Title')@@@@Component.Fields.Title@@</h1>
<div>@@MarkComponentField('Image')@@<img src="@@Image.ID@@"/></div>
<div class="FullDescription">
<div class="FullDescriptionText">@@MarkComponentField('Description')@@@@Component.Fields.Description@@</div>
</div>
...
So this uses MarkXxx
instead of the regular RenderXxx
to output just the comments.
You can find the code for these functions on the Tridion Practice wiki on Google code: http://code.google.com/p/tridion-practice/wiki/TridionUI2012FunctionsForUseInHtmlTemplates
Upvotes: 5