While theming went through a massive overhaul it's great to know there are wonderful debugging tools to help us learn and understand the new structure and API of Drupal 8. The devel module isn't stable for a production site and should only be used in a development environment. The above produces the clickable array structure allowing you to look through the variables and locate the content you wish to output. Enable kint with the module, then add the following code to your template: It also provides a clear cache button, can generate random nodes, etc. Or use a dedicated module like devel : it provides helpers which pretty print variables including arrays and objects. You can also add the Devel module to your Drupal 8 development site. 1 Answer Sorted by: 0 You can just use php's printr (). This is especially useful when needing to create field specific templates: The "x" signifies the template in use, and the "*"'s give alternative template options. The pages within your Drupal 8 website now include extra information such as: Then refresh the page and view the page source. Once you've added the code to the new file clear the cache. Within the newly created services file you want to paste the following code at the bottom: In the sites/default/ directory you want to locate the "" file, duplicate it and rename to "services.yml". There isn't an external module to install either. How many times in Drupal 7 do you find yourself looking up the naming conventions for page or node templates? In Drupal 8 they've also added the ability to create templates per field! Yes, you can go to Google, run a search and start reading through the results, or you can enable Twig Debugging.First and foremost this is not the devel module.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |