6

I'd like to access the Metadata of a Multimedia Component during publish time with a Custom Deployer. Our Page in Tridion uses only a Page Metadata schema to link to other Components, and some of these Components link to Multimedia Components.

This is used to specify specific cache times for images during publish so we can flush them from the frontend cache using a keyword field in the image Metadata.

I understand that the Metadata is not available in the Deployer package when (Multimedia) Components are linked to from Metadata, because I don't get a Components.xml file generated in the Deployer package.

Any other ideas of how to get the metadata of the Multimedia Component into the Custom Deployer?

1 Answer 1

6

Since the actual components with the needed metadata linked in the metadata of the page will not be in the transport package, you'll need to find a way to that metadata in there. There may be a couple of ways you can solve this:

  • Use the RenderedItem.AddMetadata when publishing and fish out the added data using a custom Deployer Module. A good explanation can be found on Mitza's blog.

  • Another way is to loop over the linked components in the Page metadata and push them to the resolve stack using a custom resolver, but that may be more expensive. The advantage is you don't have to write custom Deployer Module code.

  • Yet another way, as Dominic mentions in the comment: "I don't think a custom resolver is needed. You just need a component template that doesn't render any output. Then you can call RenderComponentPresentation from the page template. This should put the metadata in the package.". This is of course also possible!

2
  • 3
    I don't think a custom resolver is needed. You just need a component template that doesn't render any output. Then you can call RenderComponentPresentation from the page template. This should put the metadata in the package. Nov 5, 2015 at 9:52
  • 1
    That also works indeed. I'll update the answer.
    – Raimond
    Nov 5, 2015 at 9:53

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.