Jump to:

22998 Posts in 11620 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Static Publisher, way to do post-processing?

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

Page: 1
Go to End
Author Topic: 415 Views
  • Wilson
    Avatar
    Community Member
    63 Posts

    Static Publisher, way to do post-processing? Link to this post

    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

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: Static Publisher, way to do post-processing? Link to this post

    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.

  • Wilson
    Avatar
    Community Member
    63 Posts

    Re: Static Publisher, way to do post-processing? Link to this post

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

    StaticPublisher::set_static_publisher_theme('mytheme');

    415 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.