aleksip/shila-drupal-theme

JSON data is not reflecting on page load

jaipalsinghchouhan opened this issue · 1 comments

Json data is not reflecting on our page If we are trying to call organism in our custom file (.html.twig).

Example: Menu list.

Note: Data from JSON file is reflecting on generated HTML in ".markup-only.html".

Request you to please help us on this.

If in your Twig file you are trying something like {% include '@molecules/navigation/menu.twig' %} then Pattern Lab data for the included pattern will unfortunately not be loaded. You would have to use Pattern Lab shorthand partial syntax, i.e. {% include 'molecules-menu' %}. The problem with this is that it will not work in Drupal.

One way around the problem is to include() the pattern in the Pattern Lab data file and then print the variable in your Twig file. This of course might not be a valid option depending on how your Drupal site and theme are built.