I'm not sure whether to to file this as a bug, documentation issue or patch. Basically, I had to hack a couple of lines of code in nd_preprocess_node() to always display the node regions, even when no content is present (using a non-breaking space). I did this because my CSS use floats and relative positioning to place the left, middle and right regions. If one of those columns is absent, subsequent regions wrap, which wreaks a special kind of havoc on teaser listings. This may be related to my styles implementation and could potentially be avoided with absolute positioning but an example case or documentation would be helpful on this point.
Here's the patch, but I have no idea if this is broadly useful or even dangerous.
--- nd.module
+++ nd.module (working copy)
@@ -155,7 +155,11 @@
$region_classes[] = $region_name;
}
$themed_regions[$region_name] = $region_content;
+ } else {
+ $themed_regions[$region_name] = ' ';
}
+ } else {
+ $themed_regions[$region_name] = ' ';
}
}
Comments
Comment #1
nils.destoop commentedWith the CSS we are using, when there is no region, the main region needs to start left.
Probably, your regions need to stay at same position? So when left region is empty, main region still stays in middle?
Comment #2
amanire commentedThat's true, but it's not really the main issue. The real problem for me was that if only the right columns had data, for example, with no footer, the next teaser title would begin shifted to the right. Now that I'm thinking about this, it may have been because I cleared the floats in the footer. I bet if I cleared it for every node teaser this problem would not have occurred. However, I do want to preserve the left, middle, right column layout for this particular content type.
Comment #3
swentel commentedThere is an option now available in dev where you can toggle a checkbox to render a region with a non breaking space if wanted.