Most use cases for 'node content' involve : build some stuff involving the current node id (get all the nodes that reference this node, etc...)
What I did so far, and what I see you advised in support issues here, is basically on 'use an argument, and set it as 'nid from URL' as default arg value.
But this won't on other pages than the node's own page - meaning, setting this 'node content' to display on teasers is useless.
Maybe we need an additional 'default argument' handler : 'Nid of the node we are attached to', instead of using "Nid from URL' ? Annoying thing is that I'm not sure there's a way to restrict a default arg handler to a given dsplay plugin
Comment | File | Size | Author |
---|---|---|---|
#10 | views_attach-quickfix-362670-10.patch | 764 bytes | yched |
#4 | views_attach_default_arg.patch | 5.05 KB | yched |
Comments
Comment #1
Crell CreditAttribution: Crell commentedHm. That's similar to a use case I have on Views/OG integration, where I want to say "filter by the current OG context". Hm.
I definitely see the problem there, as then this doesn't work on teasers even though you can flag teasers for use. We may have to bring merlin in on this one.
Comment #2
Crell CreditAttribution: Crell commentedSo, just discussed this with merlin in IRC. Two possibilities:
1) Add a checkbox to the display settings to have the nodeapi implementation pass the nid (and maybe the vid as another option?) into the views_embed_view() call as an argument. Then the default handling is ignored and you get whatever the attached view is for whatever its render mode is. Done.
2) Allow arguments to be specified via token module, so we can pass in any token-accessible field of a node as an argument.
I like the simplicity of #1, which will probably still cover 90% or better of use cases.
Who wants to write the patch? :-) (Not sure about vid. I've never even tried making node revision views...)
Comment #3
yched CreditAttribution: yched commentedAgreed that #1 should be more than enough.
I can probably try to write that one.
Comment #4
yched CreditAttribution: yched commentedPatch attached.
This only implements 'nid' and 'uid' as defauly arguments. The internal option values are 'nid' / 'uid', so that it can later be expanded without too much BC issues.
Comment #5
George2 CreditAttribution: George2 commentedi made a view for my content profile content type, i tried the node content display, and profile view, and neither worked on the profile users/foo. after applying this patch, both worked as expected and appeared on the profile, so i'm happy :)
in the case of content_profile, it's better to use the node content display as it's actually a node type rather than the profile display.
thanks yched
Comment #6
George2 CreditAttribution: George2 commentedComment #7
Crell CreditAttribution: Crell commentedCommitted to dev. Thanks guys!
Comment #8
yched CreditAttribution: yched commentedThx Larry. The 'usage tips' on the project page ('Set the default value of that argument to "Node ID from URL".') could probably updated to reflect the new behavior.
Comment #9
Crell CreditAttribution: Crell commentedYep. George2 already said the project page docs were confusing. Let's open a separate issue for that. ;-)
Comment #10
yched CreditAttribution: yched commentedThere was a little clash between the commits of this patch and #362250: use content_build_modes() for finer control.
There is now a missing
break;
in views_attach_plugin_display_node_content::options_submit() that causes the 'default argument' to come back to 'None' when you submit the 'Build modes' setting.Boldly setting to RTBC.
Comment #11
yched CreditAttribution: yched commented"Boldly setting to RTBC", he said.
Comment #12
Crell CreditAttribution: Crell commentedFixed as part of another issue.