In this package, I tried to have a solution which support an unpatched acorn and uses Providers to remove the original template filters and sets the modified ones to support FSE and hybrid rendering.
Since it is WIP, it currently lacks some documentation and further testing.
Any tips on this? I replaced the filterTemplateHierarchy() -function content with your suggestion, but the blade -templates still are not working. If I dump the array using your code, I get the following:
I didn’t mentioned, that I also had to modify the patched filterTemplateInclude method and added a check, if an existing file is NOT a blade file:
public function filterTemplateInclude($file)
{
if (@file_exists($file)
&& ! str_contains($file, '.blade.php')
) {
return $file;
}
...
Secondly, the filterTemplateHierarchy() method will prefer FSE template files over blade. So, if that does not fit you, you might change the array_merge().
Hi,
I edited the filterTemplateInclude -function as you suggested, but still no success. I have a page called ‘Sample page’ which uses the (blade) template template-test-blade.blade.php. The pages element gets the template:
In the blade -template file, I have:
But none of the h1 Elements are printed to the page in the frontend. It only shows the blocks I have added in the Gutenberg editor. When dumping the wp_die(var_dump(array_merge($files, $fse_paths, $hierarchy))); inside the filterTemplateHierarchy -function, it gives:
Also, if I just return the $hierarchy the template works, but the FSE templates do not work:
Page using blade template:
Page using FSE template, no styles here at all:
@strarsis I’d like to contribute / PR this. But I need to do some more modifications and tests, since I ran into some issues while using this with a standard sage install.