Do we have the Structure Group Metadata available within DXA?

For Navigation I understand I could extend the DXA Navigation TBB, and extend DXA to get this data.

Could I build a custom TBB to publish the Structure Group metadata into the JSON?

However, if I wanted to access the Structure Group metadata from within a Page, would I be able to extend the default DXA TBBs to output the Structure Group Metadata as part of the Page? But then if the Structure Group Metadata changes, we'd need to re-publish all Pages.

Or what if I publish a separate JSON for navigation and the a Structure Group and a pointer to the Structure Group from the Page JSON?


I'm not sure if it would help in your case, but I do recall that there is a DD4T template InheritMetadataPage and InheritMetadataComponent that merges metadata fields from it's parent folders or structure groups in the published component or page. Is this something you could use in your case ?

see https://github.com/dd4t/DD4T.TridionTemplates/blob/develop/source/DD4T.Templates/InheritMetadataPage.cs and https://github.com/dd4t/DD4T.TridionTemplates/blob/develop/source/DD4T.Templates/InheritMetadataComponent.cs .

Off course, this doesn't solve your problem that you need to republish all pages if a structuregroup metadata item changes.

  • Good point about mentioning the fact that inheriting content from a Structue Group can create a dependency to a lot of Pages, which has a huge impact on Publishing. – Bart Koopman Sep 20 '17 at 8:30

The Structure Group itself was not available in DXA 1.x at all for Pages if I recall correctly, for DXA 2 (in the R2 data model) we have added it as part of the DXA/DD4T merge.

That still doesn't directly expose Structure Group metadata, I think we only have the ID available.

I think the most fitting answer is similar to your other question, which is to make your own strongly typed model, and add properties for the metadata fields you would like to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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