Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By nick_helps on
I am trying to customize a responsive grid view in D8 using Bootstrap Grid. Code is working, but I am trying to find out if some extra divs can be removed.
Currently I am getting
- two divs from <!-- THEME HOOK: 'region' -->, which work ar 'content' and 'content-inner' so they are okay (I see their purpose).
- region.html.twig calls {{ content }} which initiate <!-- THEME HOOK: 'block' --> and makes a div ===> Use ??
- <!-- THEME HOOK: 'container' --> is called which makes a div ===> Use ??, then
- <!-- THEME HOOK: 'views_view' --> creates two divs which finally calls
- <!-- THEME HOOK: 'views_bootstrap_grid' --> which makes a div of 'grid' class and then rows divs are created.
To improve my HTML text ratio I want to remove some of these divs. Do I need to write some hooks, and how do I still call the next twig files which show content?
Comments
Hi,
Hi,
Can anyone point me into the right direction. Any link explaining this would do.
Thanks!
Could you rephrase your
Could you rephrase your question?
Drupal views create a lot of
Drupal views create a lot of <Div>s.
To improve my site's HTML-Text ratio I want to remove some of those div tags if possible.
Does anyone know how to do that? Please see the list of divs given in the main question
You can alter variables (that
You can alter variables (that you have in Twig templates) using 'function hook_preprocess_HOOK'.
See this tutorial: 'hook_preprocess and hook_preprocess_hook functions in Drupal 8'.
Great, Thanks
Great,
Thanks