Drupal Planet

8: Compound (bundled) fields - your new best friend - Part 5

the Twig file

In the previous section we created the file that defines the widget formatter used to pre-format the data before passing it on to a twig file. In this part we will create the twig file that provides the markup for the viewed content.

name_field_type.html.twig

The file should be placed in the path <my module>/templates and be given the name used for #theme in the previous section with a .twig suffix.


{{ name }}

 

Don't Hack Core! - Breaking Drupal's Cardinal Rule

DON'T HACK CORE! It's THE cardinal rule of Drupal. Like another rule, Don't eat yellow snow, it's inviolate...immutable...or is it?
There is one circumstance when hacking core is a good thing. "Really?" you ask. Yes, definitely. Hacking core is a great way to find out how a particular part of Drupal is working, particularly if you can't use something like xdebug. In that case, if you want to see what the world looks like when you get to a certain place in the code, there's nothing better than sticking in some debug code. There are, however, some precautions you should take:

Subscribe to Drupal Planet
Of course, the Drupal Community isn't the only place to give back. It's a complex world, and there are as many worthy causes as their are melodies, with most being served by multiple charitable organizations. Here are a few of those that strike a 7th chord with me.