Hi there

I'm having a bit of a dilemma using this module in views.

My situation is that i have two node types - releases and tracks. Releases can have multiple tracks listed using the node reference cck field. (the songs on a music release, each track is a node)

When editing the release node, the cck widget allows the referred nodes to be set in a particular order. This displays fine in the node page for each release.

In my case though, i am hiding this field and displaying it as a view, in a block.

The view selects all tracks referred by a release using an argument of the nid of the current release being viewed, and has a relationship to that field. so basically, when viewing the node page of a release, there is a block showing all the tracks of that release.

This approach works fine - all the correct nodes are returned - except for the sorting. The tracks are being sorted by their node id. I can't seem to find anything to allow them to be sorted in the order defined by the user when editing the release node. I tried a view sort by the field delta - in this case - Content: Tracks (field_release_tracks) - delta using the relationship but that doesn't work - sorting is still done by nid, not the order set in the cck widget.

Any thoughts on how to achieve this? Or is this a bug with the module? I feel that the default sort should be that which is defined by the user when creating/editing the release node and setting the order of the tracks for the node reference field.

Thanks in advance for any help :)

Paul

Comments

_paul_meta’s picture

I looked in to this more .. seems that when in this kind of scenario using a nodereferrer relationship, if i have the disctinct setting of the view set to no, i get multiple output, but if i set it to distinct: yes ... i get one of each referred node but each has a delta of 0, so sorting doesn't work.

any clues as to why this is so and possible work arounds? seems to me like it shouldn't be so hard to sort by the delta order set by a user in the node form.

Thanks!

_paul_meta’s picture

And finally, the reason i am doing it this way and not using a view of releases showing the contents of release_tracks_field is that i need fields from the tracks, and to do some views rewriting of fields, not just the title of the referred tracks.

so although this is a bit of an obscure use of the module, i think given that node reference relationships are made available in a view, then sorting them should be possible.

any help muchly appreciated.

_paul_meta’s picture

No thoughts on this? If this isn't a bug but i'm not using the module correctly please let me know. Or if its a can't fix situation, it would be good to know. Any advice would be appreciated, this is causing a bit of a hold up on a job at the moment.

Thanks very much :)