patternlab-php-core icon indicating copy to clipboard operation
patternlab-php-core copied to clipboard

Patternlab mustache partials support broken, when using mustache blocks

Open sbuckpesch opened this issue 8 years ago • 4 comments

As we discussed on gitter, I implemented mustache templates using the Blocks pragma. The rendering works, although php fails with "Fatal error: Maximum function nesting level of '250' reached, aborting!", when using blocks in low-level patterns like atoms (even increasing the nesting level to 10.000 will fail).

But here is the acutal bug: When using blocks, patternlab does not recognize any more that a mustache partial is used. In the two screenshots you can see this. "page-app-create" uses {{< templates-focused-task}} and will extend the focused task "template". In the focussed-task pattern info, the "this pattern is included in" reference to "page-app-create" is missing. I guess this is caused by the use of {{< templates-focused-task}} instead of {{> templates-focused-task}}. This problem causes that all partials within templates-focused-task, are not populated with data from my json documents (see the header in the link supplied below..

image

image

Here is a link to the github repo: https://github.com/apparena/patterns/tree/master/source/_patterns And here the deployed styleguide: https://styleguide.app-arena.com/?p=pages-app-create (header missing) https://styleguide.app-arena.com/?p=templates-focused-task (header working)

sbuckpesch avatar Aug 10 '16 13:08 sbuckpesch

I haven't played with the blocks pragma at all but I'll definitely check it out to see what is going. I really appreciate you sharing the patterns. It'll make it easier to debug.

dmolsen avatar Aug 10 '16 20:08 dmolsen

solution that got pragma blocks working Search/Replace in ./vendor/pattern-lab/patternengine-mustache* 'PRAGMA_FILTERS' with 'PRAGMA_BLOCKS' there is no setting yet that can be passed to the 'engine' available.

yfreeman avatar Aug 26 '16 18:08 yfreeman

@yfreeman What exaxtly does this change? Does it solve the "Fatal error: Maximum function nesting level of '250' reached, aborting!" problem? I just did the changes you described, but the data inheritance problem and the problem of wrong pattern information have not been solved using this solution...

sbuckpesch avatar Aug 29 '16 06:08 sbuckpesch

@sbuckpesch we were not able to get PRAGMA blocks working https://github.com/bobthecow/mustache.php/wiki/BLOCKS-pragma until we made those changes. They worked fine in v1 of patternlab, the above fix got them to work in v2. As for the Nesting issue, it seems to be a different issue.

yfreeman avatar Sep 06 '16 20:09 yfreeman