2

Not sure if I can post my questions here, please tell me where to move my question if necessary...

1) I added to a page a custom metadata schema. In that schema, there is an embedded component field 'Summary'.

The components that I can add in that metadata field all have a Title and Article field.

How can I show in the page template with DWT the contents of the Article field?

@@Summary@@ -> displays only the tcm-id of the embedded component

@@GetFieldValue("MetaData.Summary", 0)@@ -> displays only the tcm-id of the embedded component

@@Summary.Component.Field.Article@@ -> displays nothing

I tried many other forms, but none of those works. Anyone got an idea?

2) When I loop the components to display the contents in my page template, I also want to access Target Group information and display for example a around the content, if that target group is checked by the editor while placing the component on the page. With what syntax I can do that ?

Kind regards, hope somebody will point me in the right direction!

Herman

3 Answers 3

4

DWT is not that powerfull to read fields from linked components out of the box. You can check SDL AppStore to see i there is some templating (dwt) extensions that can read fields from linked components. If you want to read those fields without extension you can write c# code fragment (or .Net assembly) in order to read and push content to the package from linked components so you can use it later in dwt.

1
  • Aha! Yes, we have the DGX installed, but I am searching for the documentation. Can't seem to download it (link is broken)... Commented Jul 20, 2018 at 11:26
2

You can read fields from linked components in DWT. You need to programmatically using C# fragment read component, push it into package and then use

@@Get("Summary.Fields.Article")@@

to read it.

1

I managed with the DGX to find the solution:

@@Get("Summary.Fields.Article")@@

Now the second problem of the target groups is still hanging...

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.