I am trying to add a region to my theme (subtheme of AdaptivetTheme), and i followed the intructions, but now i don't know how to connect the {{ page.navbar2 }} in \templates\generated\page.html.twig to the the file in \templates\navigation\navtwo.html.twig or if i am even supposed to be doing that...

Trying to copy an existing region as an example. The subtheme comes with a Navbar region and is listed in \templates\generated\page.html.twig as {{ page.navbar }} and it displays the contents of \templates\navigation\menu.html.twig (right?)

How does it know to display that file? Am I missing a key step here? (preprocessor, or some other file that defines the variables?)

If i can figure out how to make this connection, i just migth be dangerous enough to create soemthing :)

Thank you,

Comments

Jeff Burnz’s picture

See this: http://docs.adaptivethemes.com/layout/new-regions/

Adaptivetheme works differently to other themes, follow that guide - it's very simple, you don't need to create any new templates etc etc. Just follow that guide - carefully.

Forget everything you've read etc - you sound a bit confused, which is OK! Drupal is rather complicated and confusing when you're getting started.

Just follow the guide I linked to, it's all there - although your layout might be called : mytheme/layout/flex-builder, but its the exact same process regardless.

Jeff Burnz’s picture

How does it know to display that file?

What's happening is a block is placed in the region - specifically a Menu block.

yoursite.com/admin/structure/block

It's not the region that calls the menu template, it's the menu itself that uses the menu template, which is then wrapped in a block template, which is then placed (via the Block Layout page) into a region. Regions are really dumb things, they're just like a big empty box you throw things in, but they don't care about what you put in, or even know what it is.