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.
This isn't so much an issue but more a discussion. I've just started using Omega and while I'm still getting my head around how it all works, so far it's looking good and very flexible. I do have a concern than perhaps the code that is being generate is a little div-heavy. For example, on the Omega homepage (http://omega.developmentgeeks.com/), the block showing the main menu consists of the following:
<div id="zone-menu-wrapper" class="zone-wrapper zone-static-wrapper zone-menu-wrapper clearfix">
<div id="zone-menu" class="container-12 zone zone-menu zone-static clearfix">
<div id="region-menu" class="grid-12 region region-menu">
<div class="region-inner region-menu-inner">
<div id="block-block-41" class="block block-block omega-menu block-41 block-block-41 odd block-without-title">
<div class="block-inner clearfix">
<div class="content clearfix">
<div class="container-12">
<div class="grid-12">
<ul class="main-menu">
<li><a href="http://omega.developmentgeeks.com/">Omega Overview</a></li>
<li class="omega-docs"><a href="http://drupal.org/node/819164">Omega Handbook</a></li>
</ul>
While I realise to make the theme more flexible, it's going to need some number of containers, it's just that when I see this, it makes me twitch a little bit!
Any thoughts?
Comments
Comment #1
nevets CreditAttribution: nevets commentedThose divs as you pointed out increase the flexibility and I find useful. They also have the side effect of making the html self documenting.
Comment #2
rory_o CreditAttribution: rory_o commentedYou can cut down on the amount of divs that omega puts out by half through unchecking using the full width wrapper on each zone and region, which is on by default.
Most of the rest of them are normal Drupal output. Often Drupal has for each special section type (node, region, block, etc) a corresponding tpl.php file that looks like
So you can cut down on the amount of divs by creating new tpl.php files that just print $content. If you have anything that relies on adding classes into the different section types then this will of course break, so it's up to you to experiment if trying to cut down on the divs will break your site.
Comment #3
marcoka CreditAttribution: marcoka commentedComment #4
dasjoyep, coming here as i'm looking for a way to programmatically disable wrapper-divs for zones, sections and regions
Comment #5
marcoka CreditAttribution: marcoka commentedtemplates could so some of i
Comment #6
dasjoyes my solution so far is creating template overrides for all those
Comment #7
fubhy CreditAttribution: fubhy commentedTemplates overrides is probably the best solution for now. We can think about adding a slim version of all these templates by default so users can select which one they want via the UI.
Comment #8
dasjo#7 sounds like a plan
Comment #9
chrisjlee CreditAttribution: chrisjlee commentedIsn't there already a way to remove div wrappers?
Comment #10
TelFiRE CreditAttribution: TelFiRE commented+1 * >9000 for #7. That would be quite nice