-
-
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
Full Site Editing (FSE) support (frontend) #228
Comments
WorkaroundThe following workaround fixes the issue - it re-adds the original template paths so Gutenberg Full Site Editor/FSE can use the template-part files, otherwise the Blade template files are used as fallback (as they should be): // Full Site Editing/FSE fix for Sage 10 acorn template hierarchy filters
// @see https://discourse.roots.io/t/full-site-editing-fse-frontend-doesnt-load-template/21574/5?u=strarsis
// @see vendor/roots/acorn/src/Roots/Sage/SageServiceProvider.php: bindCompatFilters
$acorn_sage_template_filters = [
'index_template_hierarchy',
'404_template_hierarchy',
'archive_template_hierarchy',
'author_template_hierarchy',
'category_template_hierarchy',
'tag_template_hierarchy',
'taxonomy_template_hierarchy',
'date_template_hierarchy',
'home_template_hierarchy',
'frontpage_template_hierarchy',
'page_template_hierarchy',
'paged_template_hierarchy',
'search_template_hierarchy',
'single_template_hierarchy',
'singular_template_hierarchy',
'attachment_template_hierarchy',
];
foreach ($acorn_sage_template_filters as $template_filter) {
add_filter($template_filter, __NAMESPACE__ . '\\acorn_sage_fse_fix_template_path_before', 10);
add_filter($template_filter, __NAMESPACE__ . '\\acorn_sage_fse_fix_template_path_after', 20);
}
function acorn_sage_fse_fix_template_path_before($files)
{
global $acorn_sage_template_files_before;
$acorn_sage_template_files_before = $files;
return $files;
}
function acorn_sage_fse_fix_template_path_after($files)
{
global $acorn_sage_template_files_before;
return $acorn_sage_template_files_before + $files;
} Fix of underlying issueThe fix to the underlying issue seems to be quite simple: public function filterTemplateHierarchy($files)
{
return $files + [$this->sageFinder->locate($files)];
} Would this introduce new unintended side-effects? Related discussion: |
@strarsis could you please submit a PR to acorn to make that change and we could discuss further over there? |
Demo Sage 10 theme with Full Site Editing (FSE) / Block Templates and Partials, see this post: #141 (comment) |
Somewhere I read about the idea to use Blade-PHP as Full Site Editing Block (FSE) Block Templates and |
Thanks for taking the lead on this feature strarsis. We finally tested and got your PR merged. |
Description
Full Site Editing (FSE) with Sage 10 theme loads a blade template in frontend, no Website editor blocks are shown.
Steps to reproduce
Note that the site blocks from the Website editor are not loaded, instead the default blade-based template.
Expected behavior:
Frontend shows the blocks from website editor.
Actual behavior:
Frontend doesn't show the blocks from website editor, but the default blade template instead.
Reproduces how often:
Always.
Versions
1.16.1: 2021-07-30
Additional information
Latest Gutenberg plugin
11.7.1
.The previous code for adding compatibility for Full Site Editing (FSE) doesn't work (anymore):
The text was updated successfully, but these errors were encountered: