I have created a view and called content types events
from FILTER CRITERIA
, created template page--events.html.twig
to override design.
Problem is here I have called {{ page.content }}
which prints header, content and other footer parts eg: bread crumb so I want to call them in different div like header in other div
1 Answer
A simple solution to this would be to create a new view, with a block display, and add a contextual filter to get the current node ID from the url. Then select a field you would like and add it to the view, for example; "Header". Once you've done that then save.
Visit the "Blocks" admin page and add the block to the "Header" region of your page. Your theme should already have these. Restrict the block to display only for that content type, and then repeat this whole process for your footer field.
There are more dynamic solutions, I'm partial to Display Suite these days, something to think about if your looking to make more complex displays.
-
that solution may be don't like the admin user,I have events page eg drupal.local/events so I just need to call header content, content of page in separate divs. Oct 1, 2019 at 7:17