-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
✨ Add support for (hybrid) FSE #314
Conversation
Otherwise we'd run into `Target class [sage.view] does not exist.`
FiltersTemplates.php
FiltersTemplates trait
Otherwise we'd run into `Target class [sage.view] does not exist.`
FiltersTemplates.php
FiltersTemplates trait
# Conflicts: # src/Roots/helpers.php
allow-plugins
…h laravel/prompts
…lict with laravel/prompts" This reverts commit fb8d6d2.
@dsturm hey sorry for the delay. i'd like to look into this soon but just want to make sure it is ok if I make changes to your branch? not sure if you're using this in prod and don't want to break anything on you. |
I've merged #141 and began to familiarize myself with this a bit. In my testing, I am able to use I'm trying to understand if your additional code added to Outside of that, @QWp6t and I discussed |
Hey @Log1x, thanks for asking. I'll check if the latest changes in |
@Log1x Now, as far as I can see, this PR isn't needed anymore with the latest changes in Thanks again for your tireless work! |
While we already have a pull request (PR) for full-site editing (FSE) support by @strarsis (#141), this PR further enhances these modifications and now supports hybrid templates (Blade-PHP and FSE block templates, currently with priority given to the latter).
Requirements theme
To enable FSE support, the theme (
sage
) requires some modifications:wp_is_block_theme()
to check for FSE themes when altering the theme hierarchy,templates/index.html
needs to exist.sage
removes theme support for FSE - we need to remove / comment out this line.wp_head()
action hook, the current position of theview(...)->render()
method is too late and would result in empty styles for rendered blocks. Therefor, we need to call it prior towp_head()
, store it in a temporary variable and echo it later.Test this PR
Optionally create a new Bedrock project
Use / require acorn fork and setup (minimal) prepared sage theme
Ideas
To use block patterns like
header
orfooter
in blade templates / views, I wrote two directives which are currently located in my preparedsage
fork, but should be located inroots/acorn
:@blocktemplate('template-part')
This will render the specified block part (i.e.
header
) and fallback, if FSE is not enabled.@parseblocks
If FSE is supported, this will render all blocks.
Questions
config/view.php
) - like enabling/disabling FSE or setting template hierarchy priority?roots/acorn
?fse:init
command for acorn which will publish stubs and ensure we do not haveremove_theme_support('block-templates')
?Useful resources