Hi all,
I'm working on a site (it's on a local server so I can't show it at this time) with Drupal 7.14 and a subtheme based on Corolla (Adativetheme). All is going great, but I need to apply a particular behavior to some pages.
All pages have first (left) and second (right) sitebar, I set all of them for responsive layouts, all's ok.
But I have a few of pages with large node content, so I need to hide the sidebars for those page and to extend the main width to 100%. I think the better way is to set a taxonomy term (for example "is_large") for those "large" nodes and show/hide the sidebars based on the assignement of that term to the node.
I agree it is possible to call the function
field_get_items('node', $node, 'TAXONOMY_NAME')
in page.tpl.php
Then if the term "is_large" is NOT in the array I can show the sidebars:
print render($page['sidebar_first']);
print render($page['sidebar_second']);
Is this the right way? I think this is better (in term of resources use) than create a db query, isn't it?
There is a smarter way using adaptive subtheming? My target is the least resource consuming solution.
Thank you all,
Franco
Comments
Comment #0.0
capitolium CreditAttribution: capitolium commented(typo error)
Comment #1
capitolium CreditAttribution: capitolium commentedMy first workaround, the file is template.php
I assume to have always 2 sidebars. I need to hide all of them on some pages with a specific vocabulary term:
Last, simply set:
in MY_SUBTHEME css file.
Any better, smarter, more efficent way to do it?
Thankyou,
Franco
Comment #2
PedroMiguel CreditAttribution: PedroMiguel commentedyou can use context ( http://drupal.org/project/context/ ) to disable regions based on what you want.
Comment #3
capitolium CreditAttribution: capitolium commentedYes PedroMiguel, but it is in beta for D7. Is it stable enought?
Moreover, I suppose using functions reduces elaboration time compared with modules (is it right, Jeff?).
Comment #4
PedroMiguel CreditAttribution: PedroMiguel commentedI use context on at least 6 production projects, I use for a lot more than just unset regions, instead I use to the blocks only appear on some "contexts", to set http headers and a lot of more stuff. So I must say yes, is stable enough.
And yes every singe module raise execution time, every a blank space on a php file increase.
Comment #4.0
PedroMiguel CreditAttribution: PedroMiguel commentedfix typo: dative -> adaptive
Comment #5
mattbloomfield CreditAttribution: mattbloomfield as a volunteer commented