I'd like to be able to set context based on whether or not a given node references a particular other node.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nodereference-284871.patch | 2.32 KB | pasqualle |
I'd like to be able to set context based on whether or not a given node references a particular other node.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nodereference-284871.patch | 2.32 KB | pasqualle |
Comments
Comment #1
yhahn commentedHi Moshe,
This is an interesting request. As you may have noticed the current context_ui setup isn't very friendly for these kinds of open-ended associations -- however I'll be looking soon at making the UI more accommodating for additional widgets (in this case textfield + autocomplete).
Once that refactoring is ready nodereference integration should be fairly straightforward.
Comment #2
pasqualleversion: 6.x
quick solution with checkboxes
Comment #3
pasqualleComment #4
moshe weitzman commentedBased on a quick reading, this is a bit different from what I had in mind. In the UI, i want to select node ref field that will determine context. Then contextwill automatically be set to the value of that node ref field when viewing a node detail page. Should work for multiple fields as well.
@Pasquelle - What is the use case you had in mind?
Comment #5
pasqualleyou can set up a context "mycontext" for nodes which are referenced to node x (with selecting a referenced node from a list)..
so for example you can show up a special block for these nodes.
so, you would like to select from a list where node reference fields are listed by name? and if a node have that field then setting a context?
Comment #6
moshe weitzman commented"and if a node have that field then setting a context?". i think you have it right. i would rephrase - if a node has any values for that node reference, then set the context to be equal to those values.
In a sense, my suggestion does the same as yours with 1 context for all values whereas yours has a new context for each possible value.
Comment #7
moshe weitzman commentedI think that the solution I proposed is not compatible with the Context UI notion whereby each value gets setup independantly. That sometimes makes no sense, especially for Setters.
So, Pasquelle's patch makes more sense to me now. Disregard mine.
Comment #8
yan commentedI'm not sure if I'm just blind, but I still can't find this in 6.x-3.x. Do I miss something or has CCK compatitbility still not been implemented?
Comment #9
liquidcms commentedi have just started looking at Contexts in D7 and i also do not see any field support for conditions - for any type of field.
also, seems like some other basic conditions are missing:
- user in role
- php (so any odd condition could be set; like the missing does this field have value X)
but again, very new to contexts - so maybe missing something.
Comment #10
liquidcms commentedmy bad.. role support is there.