0

I'm a beginner of Drupal8, and I've encountered lots of difficulties till now. One of the biggest one is that when I enable the Theme Debug, I always confused about where the selected part comes from. Together with the twig file, I know that a basic page grows up from the "html.html.twig", which bears the "page.html.twig", and there're regions we defined in the info.yml. Now in the region level, most of the time I lost my way to find where the next level element comes from because there only gives a simple code of "{{content}}" in the twig file. Is there a general method to better trace all level elements?

enter image description here

  • The region template is a theme wrapper. So basically there is not much more than what you see, a div container. – 4k4 Jan 4 '19 at 8:51
  • For the illustrated picture, I want to know which script lead Drupal to hook exactly from block--local-actions-block . It looks mysterious or even unreasonable in some extent for me if I don't know where defines the relationship. – xibinke Jan 4 '19 at 9:07
  • A theme wrapper puts the already rendered content in a container. There is really not much more to say about it. – 4k4 Jan 4 '19 at 9:17
  • OK. Hope I've expressed my demand clearly and you got it. Maybe I'm not in the right way. – xibinke Jan 4 '19 at 9:32
  • The next level after region is block, as the screenshot you took shows. That is because blocks are placed in regions. As for a generic method, there isn't any. You just need to know the "hierarchy" of templates. – kiamlaluno Jan 4 '19 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.