Take the 2-minute tour ×
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

I have Component with multivalued Multimedia Component link field named "list". Each Multimedia Component has its own metadata ("thumbnail" and "altText"). I need to write a DWT TBB to extract those metadata values. I am using DGX in templating.

I tried this code but its rendering the image not metadatas.

<!-- TemplateBeginRepeat name="list" -->                                    
<div>
<a href="@@Get("Fields.list[${TemplateRepeatIndex}].Id.Metadata.thumbnail")@@">
<img alt="@@Get("Fields.list[${TemplateRepeatIndex}].Id.Metadata.altText")@@" src="@@Get("Fields.list[${TemplateRepeatIndex}].Id")@@"/>
</a>
</div>
<!-- TemplateEndRepeat -->
share|improve this question

1 Answer 1

Id is a property of the linked component, not a reference to the component itself - You already have that with

Fields.list[${TemplateRepeatIndex}]

Try removing the Id from your href and alt attributes.

<!-- TemplateBeginRepeat name="list" -->                                    
<div>
<a href="@@Get("Fields.list[${TemplateRepeatIndex}].Metadata.thumbnail")@@">
<img alt="@@Get("Fields.list[${TemplateRepeatIndex}].Metadata.altText")@@" src="@@Get("Fields.list[${TemplateRepeatIndex}].Id")@@"/>
</a>
</div>
<!-- TemplateEndRepeat -->

In fact, if you look at the samples on the Dreamweaver Get eXtension page on SDL Tridion World, it looks like Id is returned by default, so you can probably remove it from your src attribute also, like this:

<!-- TemplateBeginRepeat name="list" -->                                    
<div>
<a href="@@Get("Fields.list[${TemplateRepeatIndex}].Metadata.thumbnail")@@">
<img alt="@@Get("Fields.list[${TemplateRepeatIndex}].Metadata.altText")@@" src="@@Get("Fields.list[${TemplateRepeatIndex}]")@@"/>
</a>
</div>
<!-- TemplateEndRepeat -->
share|improve this answer
1  
Syntax for DGX can be found here: sdltridionworld.com/community/extension_overview/… –  Kunal Shetye Apr 2 at 11:28
    
I used that as well but it shows "undefined" for that particular field –  Manoj Apr 2 at 11:50
    
I think Davids code should work, but you could also try @@GetFromItem(Fields.list[${TemplateRepeatIndex}], "Metadata.altText")@@ –  Bart Koopman Apr 2 at 12:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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