I want to disable a region with Context, and I read this should be done with Context Layouts. I'm having trouble getting this to work.
The readme.txt says: "You can add layouts support to your theme by declaring additional layouts in your theme's info file."
Steps I followed:
- Have Context (3.0) and Context Layouts enabled
- Modified Acquia Prosper's .info file by adding this, based on the regions that are defined for acquia_prosper:
; Layout: Default
layouts[default][name] = "Default Prosper Layout"
layouts[default][description] = "Default Prosper Layout."
layouts[default][template] = "page"
layouts[default][regions][] = "sidebar_first"
layouts[default][regions][] = "sidebar_last"
layouts[default][regions][] = "header_top"
layouts[default][regions][] = "header"
layouts[default][regions][] = "preface_top"
layouts[default][regions][] = "preface_bottom"
layouts[default][regions][] = "content_top"
layouts[default][regions][] = "content"
layouts[default][regions][] = "content_bottom"
layouts[default][regions][] = "postscript_top"
layouts[default][regions][] = "postscript_bottom"
layouts[default][regions][] = "footer"
layouts[default][regions][] = "node_top"
layouts[default][regions][] = "node_bottom"; Layout: Administrative
layouts[administrative][name] = "Admin Prosper layout"
layouts[administrative][description] = "Prosper without sidebar_first"
layouts[administrative][template] = "layout-administrative"
layouts[administrative][regions][] = "sidebar_last"
layouts[administrative][regions][] = "header_top"
layouts[administrative][regions][] = "header"
layouts[administrative][regions][] = "preface_top"
layouts[administrative][regions][] = "preface_bottom"
layouts[administrative][regions][] = "content_top"
layouts[administrative][regions][] = "content"
layouts[administrative][regions][] = "content_bottom"
layouts[administrative][regions][] = "postscript_top"
layouts[administrative][regions][] = "postscript_bottom"
layouts[administrative][regions][] = "footer"
layouts[administrative][regions][] = "node_top"
layouts[administrative][regions][] = "node_bottom"
(What I want is to have another layout without sidebar_first region).
- I wasn't sure if defining the [template] key is required or optional (is it?), so I copied page.tpl.php to layout-administrative.tpl.php and defined it as above.
And now I'm stuck, no options to use layouts become available. Is there something wrong with the above, and/or are layouts not supported by Fusion-based themes or so? Thanks!
Comments
Comment #1
danepowell commentedSubscribing - I'm regretting upgrading to Context 3.0 in a huge way, as it completely broke my site, which relies on having a "default" block layout and then selectively disabling regions on parts of the site. My theme is Marinelli.
Comment #2
deverman commentedsubscribing
Comment #3
tshields commentedI found the answer in this video which worked for me. About half way through the video.
http://developmentseed.org/blog/2009/nov/20/admin-rubik-improved-ui-drup...
Comment #4
yareckon commentedIn case someone doesn't want to watch 15 mins of video: The problem is that the layout controls are hidden under "Blocks" reactions rather than being their own reactions category. Go in and set a block reaction and you will see the dropdown to switch layouts.
Layouts switch out the whole page.tpl.php and optionally some css files, so I believe that people conceptually expect them to have their own reaction category. I understand why they are currently under blocks though, because it doesn't make sense to have certain block configs set when the layout regions change out from under them.
Perhaps rename the block reaction to "Structure" or something as it now contains other stuff?
Comment #5
MattBrigade commentedThat makes sense now that I know where to find it. Thanks yarekcon!
Comment #6
patrick@never.nu commentedWow, searched for that for a long while, should have Googled it earlier.
Thanks a lot for the tip!
Comment #7
ar-jan commentedThanks. Once you know how to find it, it makes sense.
Comment #9
mattbanks commentedI know the issue is closed, but I'm a bit unsure still of how to implement the layouts. In my theme, I've declared this in the theme.info file:
In admin/building/context, what exactly do I need to do to enable the Landing Page layout for a particular page? I know to set the Path for the Conditions, but I'm not sure what the Reactions should be exactly. The reason I'm doing this is that I need landing pages to look very different from other areas of the site and will be coding them a bit differently in the landing.tpl.php page.
Any help would be greatly appreciated!
Thanks,
Matt
EDIT: Well, I need more coffee. Forgot to clear the theme cache after changing the theme.info file. After clearing the cache, under the Blocks Reaction, I can then select the Layout from the drop down!