Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2009 at 11:01 UTC
Updated:
18 Nov 2009 at 22:34 UTC
It would be great if attachments could attach on a per-node basis rather than just to a set of nodes. If this where possible, something like this could be done:
Master 1
- Child1
- Child 2
Master 2
- Child 3
Of course the attachment would need to be able to use the fields of the parent node as arguments.
Comments
Comment #1
merlinofchaos commentedI'm sorry, I have absolutely no idea what you are asking.
Comment #2
kurzweil4 commentedWhen you create an attachment in the view there is an "Attach to" setting. Currently you can only attach the attachment to a page or a block and at the beginning, end, or both. What I am asking is to be able to have a list of rendered attachments for each individual node. Then you would have one node from the "page" followed by two child nodes as "attachment" in table form, then another node from "page" followed again by nodes from "attachment" in table format.
Does that make sense now?
Comment #3
merlinofchaos commentedThe main reason this isn't implemented in any way is that attaching to things that aren't a view require a piece of code to look and see what can be attached where, which can be intensive. Doing it right probably requires a level of caching to make it easier, which is more effort and thus didn't end up on my TODO list.
Comment #4
nevets commentedOne approach to do this would be to create a view that has the fields for the master title and master id (assuming this is how you get the children).
Now make a view that takes a master id and lists the children.
Now back to the first view, them the row so it uses the master id and an embedded view.
Comment #5
kurzweil4 commentedNevets,
Thanks for the input. I follow you completely until step 3. Can you clarify the last part?
Thanks
Comment #6
kurzweil4 commentedMerlinofchaos,
OK.
Is it possible then, with a relationship, to have each parent node render above the children, with the child fields rendered as a table? (and this repeating for each instance of a parent node)
Comment #7
dawehnerhow is the relationship build?
there are quite some solutions out there
Comment #8
esha commentedhas anyone conquered this yet?
nevets #4 sounds like a promising approach, though I can't follow step 3 either...
nevets suggested: "... master id and an embedded view."
the problem is that there is no "embedded view", only an "attached view", which results in
_____________
Master 1
Master 2
- Child 1
- Child 2
- Child 3
____________
instead of
___________
Master 1
- Child 1
- Child 2
Master 2
- Child 3
__________
Comment #9
kurzweil4 commentedYou just have to rewrite the logic of the table view in your own template file so that it prints "master value" then a table below it. Just be sure that the data is ordered by the "master value". You will need check when the "master value" changes so that you know when to break.
Comment #10
kurzweil4 commentedI believe this can now be done using the grouping feature, so I am closing this.