0

I have a schema containing a multi-value field of type component link.

How can I render this field (component link with its template) when I write a DWT TBB for this component?

casperOne
  • 73,706
  • 19
  • 184
  • 253
AmateurCoder
  • 4,272
  • 3
  • 17
  • 31
  • Please look at the example I gave here: http://stackoverflow.com/questions/10256744/retrieving-values-of-a-linked-component-in-dreamweaver-tbb-and-making-it-sitee/10259792#10259792 – Frank van Puffelen May 29 '12 at 16:11

1 Answers1

4

A Component Link field links to a Component - it does not specify a template. So I'll assume you want to specify the Component Template to use on the DWT.

<!-- TemplateBeginRepeat name="Component.Fields.YourComponentLinkFieldName" -->
   @RenderComponentPresentation(Field, "tcm:1-2-32")@@
<!-- TemplateEndRepeat -->

So this loops over all values of the multi-value field names YourComponentLinkFieldName and render the Component linked in there with Component Template tcm:1-2-32.

All of these topics are relevant to your question:

  1. Retrieving values of a linked component in Dreamweaver TBB - and making it SiteEditable
  2. How to handle nested repeating regions in Dreamweaver TBBs in SDL Tridion 2011 SP1
  3. Retrieving values of a linked component in Dreamweaver TBB - and making it SiteEditable

I suggest you read them and apply your understanding of them.

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 4
    Keep in mind that hardcoding a tcm id inside a template will not work when content porting to another environment. You may want to provide the CT tcm id via a parameter. – Nickoli Roussakov May 29 '12 at 18:04
  • Nesting @@@@ constructs won't work, but you could easily try that instead of asking. If you must nest, you can do something like @@outer${inner}@@. – Frank van Puffelen Jun 06 '12 at 18:36
  • 1
    You can just push the CT URI into the package from a C# TBB with something like package.PushItem("MyCT", "tcm:1-2-32"). Then pick it up in your DWT. Of course your C# TBB should also not hardcode the TCM URI, but instead look it up from the relations. Or it could push all CTs that are relevant into the package by their title. Then in your DWT you can look them up by title. – Frank van Puffelen Jun 06 '12 at 18:38