Skip to content

Conversation

@zhawkins
Copy link
Contributor

Fixes issue where Twig PHP isn't rendering pseudo patterns correctly.

Twig PHP rendered needs a path to the twig file in order to render it. For pseudo patterns this path points to a json file. Twig doesn't render it because it isn't a twig file.

This adds a check for pseudo pattern first and if it is a pseudo pattern use the relPath from the base pattern instead. This means that the path to 00-homepage~emergency.json will be changed to 00-homepage.twig and rendered with the data available in 00-homepage~emergency.json.

Closes issue #1045

Summary of changes:

  • Adds a check for pseudo pattern before twig render is called.
  • If the pattern is a pseudo pattern, pass twig render the patterns base pattern path instead.

Fixes issue where Twig PHP isn't rendering pseudo patterns correctly.

Closes issue pattern-lab#1045
@bmuenzenmeyer
Copy link
Member

I dont have the bandwidth to check out these Twig PRs, can someone else please review?

@sghoweri
Copy link
Contributor

I dont have the bandwidth to check out these Twig PRs, can someone else please review?

✋ I got this - no worries @bmuenzenmeyer!

Copy link
Contributor

@sghoweri sghoweri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and verified that this is working as expected using the new Twig (PHP) renderer using pattern files with and without a number prefix.

Awesome work @zhawkins — super appreciate the fix!! 🙌

@sghoweri sghoweri added bug 🐛 twig renderer Issues and updates related to the PHP-based Twig rendering engine labels Oct 12, 2019
@zhawkins
Copy link
Contributor Author

🎉 Thanks @sghoweri !

@zhawkins zhawkins deleted the feature/1045--pseudo-twigphp branch October 14, 2019 13:51
antonia-rose pushed a commit to quelltexterin/nemo-uikit-workshop that referenced this pull request Apr 12, 2023
…o-twigphp

fix(engine_twig_php): Pseudo patterns Twig PHP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 twig renderer Issues and updates related to the PHP-based Twig rendering engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants