2

I have another problem with a list of TcmUris I pushed to the package and try to use.

I'm trying to render the different components whom ids are in the list "slideshareList" with their common template which is the 2 second parameter provided in the RenderComponentPresentation method.

The code below is what I tried so far (not working, displaying nothing)

<!-- TemplateBeginRepeat name="Paragraph" -->
<!-- TemplateBeginIf cond="TemplateRepeatIndex = paragraphindex" -->

// SOME CODE     

// WHAT IS NEW
<div>@@RenderComponentPresentation(slideshareList[${paragraphindex}],"tcm:125-48340-32")@@</div>

<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->

Thanks in advance for your help

7
  • what exactly are you trying to accomplish, did you want to render the content of the linked Components? Please edit your question and provide a bit more information/detail. Commented Jul 21, 2016 at 15:16
  • I've added some informations, i hope it's more clear! Thank you
    – user1178
    Commented Jul 21, 2016 at 15:27
  • What is paragraphindex and where is that coming from? I suspect, at first glance, that this is saying "if 0 == ''", which is why nothing is happening. Also I think you need a double equals in the DWT condition. Commented Jul 21, 2016 at 15:37
  • is this a duplicate of tridion.stackexchange.com/questions/15164/…? and possibly tridion.stackexchange.com/questions/15119/… In that case its better to ask a single question and ensure you get a valid answer than to continue creating new questions around the same. Commented Jul 21, 2016 at 15:43
  • Actually , i made a mistake i used TemplateRepeatIndex and not ParagraphIndex as parameter. To be completely honest with you , i have no idea what paragraphindex is yet. This is not my code and i just try to understand it right now. The thing i can say is the code definitely goes into the TemplateBeginIf because there are a lot of instructions inside that are reached. I just deleted them for more clarity
    – user1178
    Commented Jul 21, 2016 at 15:47

1 Answer 1

3

What you are roughly trying to do I think should read something like

<!-- TemplateBeginRepeat name="Paragraph" -->
  <div>
    @@RenderComponentPresentation(slideshareList[${TemplateRepeatIndex}],"tcm:125-48340-32")@@
  </div>
<!-- TemplateEndRepeat -->

Don't try to assign variables through the Template Expression Language, you can't do that. But in this example slideshareList is also still undefined. My Template Expression Language is a bit rusty, haven't used it for years, but try searching this site on similar questions, since there are a whole bunch of answer out there.

Other options you have in regards to using embedded Component links is checking out this Tridion Practice Cookbooks https://github.com/TridionPractice/tridion-practice/wiki/IteratingOverMultivalueEmbeddedFields and the DWT Get Extension https://sdltridionworld.com/community/extension_overview/dreamweaver_get_extension.aspx

1
  • It works! thank you.
    – user1178
    Commented Jul 21, 2016 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.