A tiny module attached exposing nd-build modes of a full node view as conditions and reactions to context-3.x; Context-2.x will not work.
Condition and reaction currently *only* operate on full node page views.
nd_context_bm-condition: currently only makes sense in unison with e.g. nd_switch_bm (because otherwise the build mode will always be "full", and you could just use context's node-type condition :).
nd_context_bm-reaction: add nodes (e.g. node/1, node/2 ...), add a new context with a path condition for some of these nodes (node/1) and as reaction choose a different build mode (and context's debug) to see that it is activated, check node/1 etc.
note:
- something to potentially watch out for: i don't think that context reacts on changes triggered by contexts, i.e. if you change a build mode via a nd_context_bm-reaction to build mode "A", an existing nd_context_bm-condition on build mode "A" is not necessarily triggered!
- it might make sense to overrule all kinds build modes of nodes being displayed by means of context (e.g. in views), but this could get really crazy :)
| Comment | File | Size | Author |
|---|---|---|---|
| nd_context_bm.tar_.gz | 1.48 KB | frega |
Comments
Comment #1
swentel commentedNice again - did a quick test and works out fine.
Code is fine too, it's ready to commit as far as I know!
Comment #2
frega commentedsure, if you're cool with the code, go ahead! i would like to explore where one can go with this integration module: one could do great things but also cause a lot of havoc on a site :)
Comment #3
swentel commentedCommitted, thanks!
You indeed could go wild with this one, love it!
Comment #5
decipheredThis no longer seems to work, which is a real shame. I suspect it's just an issue with the API change in the latest version of Context.
Comment #6
swentel commentedThey did an API change in the latest version of context, now that's fun, sigh. Hope I can get frega to chime in here.
Comment #7
frega commentedSure i'll be happy to have a look - but it'll be a few days - if you can point me to the context.module api-change it'll maybe go faster :)
best,f
Comment #8
frega commentedI am afraid - I can't reproduce the problem with ds-6.x-1.4, nd-6.x-2.4, nd_contrib-6.x-2.4.
Since there hasn't been any changes in context (still at 6.x-3.0), i think something else is at work.
I've had problems w/ contexts (w/o this module) mysteriously not being activated in the past; resaving the context has helped in most cases (i know that's hacky).
w/o more input i am afraid there's not much i can do - sorry. setting to "needs more info" - please reopen, will look it into it then.
Comment #9
swentel commentedalso mentioned in #1073102: Buildmode not switched
Comment #10
swentel commentedWill close this for now, as frega said, clear steps to reproduce will probably help more to debug.
Comment #11
decipheredFinally back on a project where I need this. Quick test and not working, so will do some debugging and provide some more information and a patch.
Comment #12
decipheredOk, so I narrowed it down to the conditions, even though the conditions I were using where valid and the reaction was being applied (on the second hit of hook_nodeapi('view') (which in itself is suspect)), it appears that I can only (so far) get it to work if I use the 'path' condition, whereas my initial test cases where using taxonomy as the condition. I also tried content type as the condition, but no luck there either.
Strange. Not sure if it's just a limitation of Context, this sub-module, or something else.
Happy to provide more information if I can, but for now I'm just going with path condition as a workaround.
Cheers,
Deciphered.
(Leaving open for a response).
Comment #13
xtfer commentedDid you get anywhere with this? I wonder if you have two nodes being loaded on one path, with the second one cancelling out the behaviour of the first?
Im going to mark this 'needs more info'.
Comment #14
halefxI can confirm that attempting to use either the node type condition or the taxonomy condition kills the build mode reaction even though other reactions (like adding a block) will work just fine. The theme condition added by Context Plugin Extras works fine.
Context 6.x-3.0
Context Plugin Extras 6.x-3.0-beta5
Node displays 6.x-2.8
Node displays contributions 6.x-2.8
Comment #15
ericaordinary commentedI can confirm that the configuration in #14 works to trigger the build mode.
Just a note on this, if you are using Mobile Tools module and the Mobile build mode for your mobile theme you need to select "Enable a Mobile Tools display mode" in the mobile_tools settings. Otherwise your build mode doesn't get triggered. This might help out some others who get stuck like I just did.
Comment #16
ericaordinary commentedLooks like I've been thrown a red herring. Turns out the context wasn't working at all, but Mobile Tools provides its own build modes that integrate with display suite.
I can't get the Context Plugin Extras theme condition to work for my mobile theme at all, possibly because of inteference by Mobile Tools module. See http://drupal.org/node/1156852 for some more details on that issue, which may be useful for others who end up here with problems with mobile themes.