Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticPublishingTrigger on a DB object / how to? #151

Closed
lars-lemon8 opened this issue Nov 22, 2022 · 2 comments
Closed

StaticPublishingTrigger on a DB object / how to? #151

lars-lemon8 opened this issue Nov 22, 2022 · 2 comments

Comments

@lars-lemon8
Copy link
Contributor

Hi,

I am trying to get a write() on an ORM dataobject to trigger the static publishing of several related pages. Looking at the docs, it seems I need to implement the StaticPublishingTrigger interface on the Dataobject to force this to happen.

Doing that however, does not seem to trigger the necessary calls to objectsToUpdate / objectsToDelete functions from within the PublishingEngine. The docs aren't very clear on the exact usage.

Looking through the PublishingEngine code, it seems there are only hooks for onBefore and onAfter publish methods, so these won't trigger on a DB object wrte() , or am I missing something?

Can anyone help me out with a concrete example? I'll put up a PR for the docs once I get it going.

@lars-lemon8
Copy link
Contributor Author

Having tinkered around a bit I figured it out. In order for the publish-hooks to be picked up, the SiteTreePublishEngine extension needs to be added to the relevant DataObject Class. This wasn't clear for me from the docs.

@lars-lemon8
Copy link
Contributor Author

added a PR for docs change -> #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant