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

merlinofchaos’s picture

I'm sorry, I have absolutely no idea what you are asking.

kurzweil4’s picture

When 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?

merlinofchaos’s picture

The 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.

nevets’s picture

One 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.

kurzweil4’s picture

Nevets,

Thanks for the input. I follow you completely until step 3. Can you clarify the last part?

Thanks

kurzweil4’s picture

Merlinofchaos,

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)

dawehner’s picture

how is the relationship build?

there are quite some solutions out there

esha’s picture

has 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
__________

kurzweil4’s picture

You 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.

kurzweil4’s picture

Status: Active » Closed (fixed)

I believe this can now be done using the grouping feature, so I am closing this.