Closed (fixed)
Project:
Context omega
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 May 2013 at 16:15 UTC
Updated:
1 Jun 2013 at 22:20 UTC
For some reason I cant get this to work with properly. The layout changes fine if I use a 'path' condition to define the context, but when I use the 'node-type' condition, the selected layout is ignored and the site default is used.
Comments
Comment #1
attiks commentedCan you enable the context inspector block and see it the reaction is there?
Comment #2
core44 commentedYes, the reaction IS showing in the inspector and the value is set to the correct layout. It just doesn't seem to actually switch it for some reason.
Some more info:
My layouts seem to have no issues when activated manually or by a path reaction in context so I know they are working.
I use a sub theme of Omega 4, and define a default layout in the info file with
settings[omega_layout] = 'my-default-layout'(i have commented this out but it didnt help)Version installed are.
Context Omega 7.x-1.0
Context 7.x-3.0-beta6+6-dev (have also tested with the latest stable release)
Omega 7.x-4.0-beta3+10-dev
Thanks
Comment #3
attiks commentedBug confirmed, if I had a path (node/19) $this->get_contexts() contains the context, but if I set the condition on the content type, the same line is an empty array.
It looks like the execute is missing some logic, looking at the order of execution it looks like the execute happens before the node type check, I'll try to debug some more later today.
Tested with the following context
Comment #4
attiks commentedFixed in latest dev version
Comment #5
core44 commentedexcellent, thank you. just spent the last hour trying to fix it myself... what was the issue in the end? Something to do with the execute in hook_innit() ?
Thanks for the module.
Comment #6
attiks commentedProblem was that this plugin was executed before the node conditions got evaluated, you can run into something similar if you try using taxonomy term or other conditions.
Comment #7
smerth commentedHi Attiks,
I just updated to the latest git version of the module because omega context wan't switching the layout in reaction to the node-type, as per this issue. However, now in response to "node type" the page is picking up the css from the layout but not the template file...
How can I help you troubleshoot this issue?
Comment #8
attiks commentedYou can try to debug in http://drupalcode.org/project/omega.git/blob/refs/heads/7.x-4.x:/include... to see which layout is set, but since your css is the right one, it's strange your layout is wrong
Comment #9
smerth commentedI have been testing different combinations of layouts and contexts - taxonomy, node type and path specifically. It seems like all three of these are working... the whole layout (css and tpl files) changes as you expect it to...
except for the context
<front>For some reason a context set to respond to
<front>won't change the layout.Can anyone confirm this?
Comment #10
attiks commentedyou mean by "context " a context with a path set to
<front>? That should work but i double checkComment #11
attiks commentedI double checked by creating a context for
path = <front>and reaction switching the layout and this works.Comment #12
smerth commentedHi Attiks, thanks for checking that context path = works. Knowing it was a problem with my setup made me got through everything. I found another context over-riding the context for front. Sorry for the trouble and thanks for the help. And the great module!