Closed (fixed)
Project:
Simple Style Guide
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2020 at 23:18 UTC
Updated:
27 Apr 2020 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mortona2k commentedThis patch adds a theme hook for template patterns and a template that prints {{ pattern|raw }} in place of {{ custom_pattern.pattern|raw }} in simple_styleguide.html.twig.
There should be no change with the regular use, but now we can add templates to override the pattern output. The pattern is available as a template variable.
I used the template name styleguide-pattern.twig. The template suggestions will convert underscores to dashes, but that's not the case when defined in hook_theme. If you use this naming pattern for the file, you don't have to specify the template name in hook_theme. I suggest removing it in the other definition and changing the filename for consistency.
Comment #3
mortona2k commentedThis one fixes the template source.
Comment #4
xpersonas commentedGood idea. I implemented your patch and suggestion with a bit of tweaking. It's up in the dev version now. Please review.
Comment #5
xpersonas commentedBeen testing this without issue on multiple sites. Feature is implemented in version 1.7.
Comment #6
xpersonas commented