Hi,
i've added several context's to display differnt blocks per context. but i need an option to set a default context to show a default block, which should only be shown if no other context is present...any ideas?
regards
Hi,
i've added several context's to display differnt blocks per context. but i need an option to set a default context to show a default block, which should only be shown if no other context is present...any ideas?
regards
Comments
Comment #1
yhahn commentedThis is a really interesting request... I don't have any good ideas for incorporating this right now but I'll keep it in the back of my head for the future...
Comment #2
steven jones commentedThis is possible with context, if you add a context into your namespace and make it a 'sitewide context', but make context evaluate it first, then it will be a default context. If you give it the value of say: 'a_default_context' then it will get sorted to the top and evaluated first.
This is a bit of a hacky way to do this.
Comment #3
benleivian commentedI'd like to add my vote for having a default context as well. It would do wonders for the current site i'm developing. I will give Steven Jones' idea a try. Thanks.
Comment #4
a_c_m commentedCan confirm the hack/work around works, but dont try to be too clever '_context_name' doesn't seem to work as expected, where as 'a_context_name' does.
Comment #5
steven jones commentedMaybe we just need to rename the sitewide context to indicate it can be used as a default context. Also need to add some documentation of how to do things like this.
Comment #6
steven jones commentedDecided that I'm not going to rename the context, but will need to add some documentation about 'default' contexts.
Comment #7
steven jones commentedAdded the help in http://drupal.org/cvs?commit=357604
Comment #9
TwoMice commentedMaybe the OP would disagree, but I think the fix here doesn't match the use case. OP said: "to set a default context to show a default block, which should only be shown if no other context is present". The solution provided in #2 shows the blocks in the sitewide context on all paths, it doesn't account for the "only show if no other context is present" part: it's truly sitewide, regardless of any other contexts that apply.
Comment #10
TwoMice commentedOkay, sorry about that. I was unaware of the very cool context exclusion conditions explained here: http://drupal.org/node/813954#comment-3267016
Comment #11
TwoMice commented