We are publishing an xml file from our CMS. We have to add some additional information in that xml file before it get deployed. I want to edit it in the storage extension. How can we achieve this?
In the XML file I want to add some xml nodes.
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.Sign up to join this community
Once you have added the "additional information" using
Engine.PublishContext.RenderedItem.AddMetadata, you can use a Deployer Extension. Here is an example (framework) to deal with Deployer Extensions:
On a side note, if what you need to do is to add more nodes to your xml, you can do it in the template as well, not necessarily using the
.AddMetadata method but modifying the
Output instead. If this is something you need strictly to happen at deployment time, using the framework above, you can write your own
CustomAction which gets the page output (there's utils methods to access the
pages.xml within the deployment package) and modify the xml (add more nodes) based on your requirements and then saves it back to the original xml file.