Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Static Publisher, way to do post-processing?


Reply

3 Posts   487 Views

Avatar
Wilson

13 October 2011 at 4:46am (Last edited: 13 October 2011 4:46am), Community Member, 63 Posts

Hi everyone,

We're currently using static publisher to 'spit out' content that's used in our eCommerce system.

I'd like to be able to parse the output to swap out image and resource links so that they point to our CDN but still keep the ability for the content editors to preview the content locally.

Anyone know a way to 'listen' for the publish event and then parse the output for just the static content?

Thanks!
Wilson

Avatar
MarcusDalgren

13 October 2011 at 5:09am Community Member, 288 Posts

There are some actions you can look at in SiteTreeDecorator that run when a page is published/unpublished. I don't know if/how they relate to the static publisher though. I think the best solution would probably be to hook into the static publisher if possible and make the changes when the html is created instead of making the changes when the content is written to the database.

Avatar
Wilson

13 October 2011 at 9:20am Community Member, 63 Posts

Found this! You can set a different theme for static content.

StaticPublisher::set_static_publisher_theme('mytheme');