Only one context within a particular namespace can be active at any one time, yet there is no way to set or order of priority and it appears that the contexts are just processed in the order that they are listed in the context overview page.
For example, suppose I have the following two contexts:
context_ui -> section -> section_a:
paths: /section
context_ui -> section -> section_b
paths: /section/subsection
Which one will be applied when I visit /section/subsection? Technically they both apply, but because they are both in the same namespace, only one of them will actually be applied.
Each context should have a weight and a drag/drop interface to allow control over that weight. This would allow users to ensure that contexts with a higher priority take precedence. In the example above, I could drag the subsection above the main section to ensure that section_b was applied at /section/subsection.
Comments
Comment #1
electblake commentedagreed 100% - Currently (as a work around) I precede my context values with a number so I can have finer grain control.
context_ui -> section -> 1_index
context_ui -> section -> 2_node
context_ui -> section -> 3_form
Comment #2
jdwfly commentedThis is definitely needed. Just a few things I've noticed though.
1. Two contexts can be active on a page if they are in different namespaces, but this will show all blocks with no way to order them. For example:
context_ui-> section -> section_a
path: /section
context_ui -> section_1 -> section_b
path: /section/subsection
2. Inside the same namespace your contexts must use the same arguments. For example, I had a context for all pages (by node pages) to have some default blocks, but there is a certain node (by menu trail) that is going to have different blocks. I had to set the menu trail and the node pages in order for my alternate context to work and then it also had to be below the default so that it would apply last.
Isn't this more of a feature request instead of a bug report? Are there any plans to implement some type of weighting system?
Comment #3
servantleader commentedsubscribing
Comment #4
kle commentedsubscribing
Comment #5
emackn commentedsub
Comment #6
emackn commentedAs a workaround, you can export the context, change the weight, then re-import the context. Be sure to remove the "set_data" wrapper around the context array.
Comment #7
steven jones commentedI don't think this will be happening in the 2.x branch anytime soon, as you can already set the ordering using the 'value' of the context (alphabetical order).
Comment #8
lpalgarvio commentedi think this is partially related to http://drupal.org/node/455908
Comment #9
steven jones commentedNo more features for the 2.x branch I'm afraid.
Comment #10
drecute commentedI'm afraid, this feature is not available in 3.x branch either. There's just no way to order 2 different contexts in the same region.
For example, you have 2 contexts with different conditions with block reactions to be available in the same region, how do you weight this?
Comment #11
lpalgarvio commentedhow about for 3.x?
Comment #12
jerry commentedSubscribing.
Comment #13
steven jones commentedOnce I get my head around 3.x, I think we can revisit this.
Comment #14
febbraro commentedI think the problem of merging contexts is complex and not likely to get solved soon, but as part of #1005190: Show Row Weights doesn't show row weights we dont reset weights on submit so you can structure your weights as such to present a possible interleaving approach without having to export or alter your contexts.