2

I am writing a DWT in which i need to read metadata of multimedia component added in a component. following is the component structure.

<content>
   <level1>
      <level2>
            <image>
      </level2>
      <level2>
           <image>
      </level2>
  </level1>
  <level1>
     <level2>
         <image>
     </level2>
     <level2>
        <image>
     </level2>
  </level1>
</content>

Here Level1 is a multi valued embedded schema . Level2 is also a multi valued embedded schema.

I am able to retrieve image tcm id as below. But I am unable to read metadata of the image.

<!-- TemplateBeginRepeat name="Level1" -->
    <!-- TemplateBeginRepeat name="Field.Level2" -->
           @@Field.Image@@
    <!-- TemplateEndRepeat -->
<!-- TemplateEndRepeat -->

I tried the below options to read altText field in metadata. @@Field.Image.altText@@ @@Get('Field.Image.altText')@@

Please help.

1 Answer 1

1

Try using @@Field.Image.MetaData.altText@@.

@@Field.Image@@ gets you the Image Component. Once you have the Component, use the MetaData property to read any associated metadata.

Below is what the SDL Docs say:

Component.MetaData.<FieldName>
The value of a metadata field of the Component called (only use this construction if you have a metadata field called Title, Name or ID, or if you have a metadata field with the same name as a data field).

Check below, the various properties including MetaData.

enter image description here

Your Answer

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

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