I would like to add a module inside of the footer region, but right now I can only get it to render inside the “Content”. How do I create a modular and get it to render inside of a different region than “block content” ex “block footer”
This is more of a question on how to control where the modular is being outputted inside of the html.twig template file.
So if I want some partial before and after a modular, how do I achieve this?
Right now all the modular are being place just after each other, and I can’t figure out how to place partial inbetween.
Like
{% include 'partials.html.twig' %}
{{ page.modular }}
{% include 'partials.html.twig' %}
{{ page.modular }}
By default modular pages are used to display in main content one after the other, modular pages are called in a loop, then you cant out of the box stop the loop and call a desired partials content.
Seems like you are seeing partials strictly as static content, but you could have partial twig to render dynamic content. page.find() is your friend for this task.
For your footer this is my approach:
Add your dynamic content in a regular page ie. /partials/dinamic1/default.md
then you could have a partials.dinamic1.html.twig file
Now you have a partial that actually renders content of a dinamic page, and you could include the partials.dinamic1.html.twig wherever you need in other twig files.
For modular pages that needs fixed content between modules just do the opesite, I mean, you could do a modular/partialx.html.twig file wich only includes a partial twig file.
{% include 'partials/partial-x.html.twig' %}
Then simply add that modular page to your modules stack
Ah that makes sense.
Modular pages are only for stacking and not for ordering in weird ways.
I’ll try to create a page, create a partial that includes that and put there were I want.
Thanks for the respond and for directing me in the right directing!
Now I guess that the partial would just include the content of the footer page, but I get an twig_error: Unknown "p" tag. Did you mean "import", "spaceless", "autoescape" in "partials/footer.html.twig" at line 1?
and I can see that inside of my editor it highlights the p in “p=page.find” as if it were incorrect.
Do you have an idea on what might could be the problem?