For now, as documented in #988208: What's the best way to make the existence of a region (left, first, for instance) a context?, regions only seem to be shown for the active theme. For example, if I use a zen-based theme (which uses the "first" region) as my main theme and Garland (which uses "left"), editing a context doesn't show me "left".
I would suggest, rather than showing the list of the regions on the default theme, showing something like:
- left (in Garland, Pushbutton)
- first (in Zen)
- ...
And allowing users to put blocks in any of those regions. Going further, why not allow users to add regions which are not even in the current site's active themes? Thus, if I'm developing a Feature on Garland, but I know it will be used on site with a zen-based theme, I don't have to have zen installed in order to set a block to appear in the "first" region.
Comment | File | Size | Author |
---|---|---|---|
#24 | context-n988222-24-d7.patch | 5.09 KB | alex.skrypnyk |
#16 | context-n988222-16-d6.patch | 1.9 KB | DamienMcKenna |
#16 | context-n988222-16-d7.patch | 3.08 KB | DamienMcKenna |
#12 | show_all_regions_in_ui-988222-12.patch | 1.67 KB | artkon |
#10 | show_all_regions_in_ui-988222-10.patch | 1.68 KB | artkon |
Comments
Comment #1
alberto56 CreditAttribution: alberto56 commentedHere is a patch against the 7.x version. In the attached image, you can see that the regions for bartik, seven and zen are visible in the blocks reaction for my context. I tried using a single context to define blocks in regions in various themes, and it works for me.
Comment #2
alberto56 CreditAttribution: alberto56 commentedComment #3
Marko B CreditAttribution: Marko B commentedWill this be ported to D6 also? I have same problem there.
Comment #4
xjmTracking. (Help fix "+1 subscribe" posts: see http://drupal.org/node/34496 and http://3281d.com/2009/03/27/death-to-subscribe-comments)
Comment #5
caschbre CreditAttribution: caschbre commentedI love context and have found myself in situations where a client wants to make several themes available to their users. Context breaks down for me at this point. I would love to see capabilities to add blocks to regions for (at least) active themes if not all installed themes. And as mentioned... going a step further and simply adding blocks to regions that may or may not exist for use in features, etc.
I would love to see something like this in D6 and D7.
Might I suggest an alternative to this. The issue that may come up is Garland and Pushbutton not using "left" in the same way. Or maybe we want to put a block in Garland->left but not Pushbutton->left.
There are at least three possible use cases for this... (in no particular order)
The first being a condition is created to test what theme is active. The reactions would still have to have some UI to allow for selecting regions by theme to add blocks to. This could also lead to a lot of conditions.
The second being multiple 'add block' reactions for a condition. Each 'add block' reaction would be for a different theme.
The third being a single 'add block' reaction with some UI that allows the admin to add a block to a region for each theme.
Comment #6
alberto56 CreditAttribution: alberto56 commented@caschbre
you've made some good points, and here are my thoughts:
(1) Long term, I think it would be a good idea to somehow standardize region names in Drupal. See #1136436: Standardize region names based on popular contrib theme patterns
(2) I would argue against making it possible to create arbitrary regions. If one wants to create a develop a context for a given theme, just install and enable that theme on your development site, and use something like the patch in #1. The confusion of allowing users to add blocks to non-existant regions is not, I believe, justified by the added convenience.
(3) I like your idea of having a "condition [...] to test what theme is active", and also I prefer a single "add block" reaction as opposed to several (it's just simpler to use, I think).
Thoughts welcome, thanks.
Albert.
Comment #7
Marko B CreditAttribution: Marko B commentedI just added missing regions to active themes info file and solved this problem that way.
Comment #8
timaholt CreditAttribution: timaholt commentedThis might be a crazy idea but what if the reaction pane had tabs across the top of it - one for each enabled theme? That would make the ui make sense, and also you could apply any reaction to any theme. You could even have an "All" tab that would pre-populate reactions in all the individual themes, including blocks (similar to how admin/build/block works). Then you could override/tweak the reactions per theme if you wanted, or keep the default 'all' behavior which is essentially how it works right now.
Comment #9
el_reverend CreditAttribution: el_reverend commentedtrimsyndicate. That sounds like a good plan. And adding missing theme regions to a theme might be a good way if you, the developer are also maintaining the site, however fails when you have content maintainers that do not know how to manipulate a theme (not that you want too many cooks in the kitchen).
Comment #10
artkon CreditAttribution: artkon commentedI applied the patch to d6 version 3, pretty sure its working now displaying all regions of all themes.
Comment #11
alberto56 CreditAttribution: alberto56 commented@artkon, thanks, however I will change this back to 7.x-3.x-dev, as, even though the patch may work on 6.x, this should be fixed first in 7.x and then backported.
Comment #12
artkon CreditAttribution: artkon commentedFor my previous patch(up), had some constants (REGIONS_VISIBLE, REGIONS_ALL) that are not part of D6 so switched them to the appropriate strings.
Comment #13
windmaomao CreditAttribution: windmaomao commentedthanks @artkon, really great.
my question is that currently only the regions that exists in the currently activated theme is shown, regions with different name in another theme is not shown for some reason. Can anyone confirm that ?
Comment #14
windmaomao CreditAttribution: windmaomao commentedi guess, this bug might have something to do with Context layouts module, because when I select different layout, the region name list changes.
Comment #15
windmaomao CreditAttribution: windmaomao commentedMaybe we need to add a function to determine what is our currently selected theme to work with first. Then the rest of the functionality (ex. context layout, region list) will just follow. The module Context Reaction Theme might be integrated into Context module so that the current selected theme function can be accessed.
Comment #16
DamienMcKennaHow about just highlighting the default theme by making the them name bold?
Comment #17
jonloh CreditAttribution: jonloh commentedWorks great for me. It should be included into the Context module.
Comment #18
Nitebreed+1 for including this patch
Comment #19
nadavoid CreditAttribution: nadavoid commentedJust used this patch for the first time. It works great, and is very useful for sites that are using multiple themes.
Comment #20
havran CreditAttribution: havran commentedThis is useful. +1 for commit.
Comment #21
davidwatson CreditAttribution: davidwatson commentedReviewed the D6 version of this, looks solid. +1 to RTBC.
Comment #22
yorkshire-pudding CreditAttribution: yorkshire-pudding commentedHas this patch been incorporated into the latest release (7.x-3.1)? If so, I can't seem to get it to work, and some of the lines from the patch don't match up to what is in the file, so I assume the patch is not valid for the current release.
Thanks
Martin
Comment #23
colanI think the D7 one needs a re-roll:
Comment #24
alex.skrypnykRe-rolled patch for D7 from #16 against 7.x-3.x-dev (61bf8909d3d99999397e937f15aefe1e7b683510)
Works perfectly together with context_omega in production.
Comment #25
8thom CreditAttribution: 8thom commentedAdded a simple sandbox module that adds all active regions from all active themes to the default theme for use in context.
https://www.drupal.org/sandbox/8thom/2321193
Comment #26
alex.skrypnykPath in #24 works in production for the last 6 month. Someone, please review so we can get this one committed.
Comment #27
gmaxime CreditAttribution: gmaxime commented#24 worked for me (Context 7.x-3.6). Thank you
Comment #28
NitebreedComment #35
aitala CreditAttribution: aitala commentedThis patch appears to work in version 7.x-3.9 of Context. Can anyone else verify?
Eric
Comment #36
aitala CreditAttribution: aitala commentedThis patch appears to work in version 7.x-3.10 of Context. Can anyone else verify?