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

Set preview mode earlier #2307

Merged
merged 2 commits into from
Apr 21, 2022
Merged

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Apr 21, 2022

What is this pull request for?

This sets @preview_mode before executing any OnPageLayout callbacks, so that the callbacks can identify whether they are in in preview mode or not.

Notable changes (remove if none)

This just changes the order of callbacks.

Checklist

mamhoff added 2 commits April 21, 2022 17:27
When running `OnPageLayout` callbacks, it's probably wise to have
`@version` available for choosing draft or public versions of pages
(e.g. when loading a referenced page via the
`Alchemy::Ingredient::Page`).
It's useful to have not just the page, but also the page version
available in `OnPageLayout` callbacks.
@mamhoff mamhoff requested a review from tvdeyen April 21, 2022 16:02
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thank you

@tvdeyen tvdeyen merged commit 93c850f into AlchemyCMS:main Apr 21, 2022
tvdeyen added a commit that referenced this pull request Apr 26, 2022
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

Successfully merging this pull request may close these issues.

2 participants