Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.0-beta
Component:
Views Integration
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2008 at 18:38 UTC
Updated:
24 Oct 2008 at 16:52 UTC
Comments
Comment #1
petertj commentedI also encountered this problem, and with Node Reference fields too... so this may be a limitation of the referencing mechanism - either fundamental limit, or not yet implemented?
Possibly related issue - in table-formatted views, grouping by reference fields is broken - it creates a separate one-row table for every node in the view, regardless of the values in the reference field.
Comment #2
yched commentedThe only 'sort' that would be available would sort on the numerical user id (or the node id in case of a noderference field), which doesn't make much sense.
I do think that if you add a 'relationship' on the user field, you might be able to add a sort criteria on whatever user property. Haven't actually checked, though.
Comment #3
karens commentedYes, adding a relationship is the answer. Once you add a relationship to the referenced node, you can add a sort for any field in the referenced node -- title or anything else that makes sense.
The possibly-related issue is not related and needs its own issue, Please open a new issue for the problem about grouping by reference fields with more details. It's not clear if you are having trouble with the grouping created by the option to 'group multiple values' in the field setting or by the new Views option to group values.
Comment #4
william_frane commentedCapital! Thanks for the assistance, everyone.
Comment #5
petertj commentedThank you! Now using a relationship to the referenced node title. Makes perfect sense in retrospect... but it was not immediately clear why the "Sortable" option was missing in Basic Settings:Style:Table.
Might it be feasible to show an advanced help (?) link in place of the missing Sortable checkbox? And/or add an explanation to the existing Table output style and Sorts help pages. If it makes sense, feel free to point me to the right place to contribute on expanding the help, happy to do my part.
Found what was causing my grouping problem, happens when the "Link this field to its node" option is checked on a direct node reference. I'll look to see if that's already been reported under CCK, and post a new issue if needed.
Thanks for the great work, and great support!
Comment #6
yched commented@Karen : Actually I wonder if noderef / userref fields should be proposed as 'Views fields' at all. All they do can be done via relationships, and so much more.
Comment #7
karens commentedHmm... that's an interesting question. Maybe you're right, that never really occurred to me. Let's sleep on that idea :)
Comment #8
petertj commentedAh, that makes sense... but please don't take away the Full Node display, which I have since used in another view.
I tried doing this using a relationship field, but it only appears to offer the Teaser, which cut off long descriptions 'cause we have other CCK fields at the top of the Project node.
Is there some other way to get that? Maybe Full Node could be added to the standard field options? Am I missing something?
Comment #9
karens commentedIf the Full Node display isn't available for a relationship, that is probably a bug that needs to be fixed. I assume it would be a Views bug since I don't think there's anything we can do on the CCK side to set the relationship up differently.
Marking this back to active while we discuss.
Comment #10
petertj commentedI had previously come across an old dialog on this topic: http://drupal.org/node/70380
Seemed to reach a partial resolution there... moving node references into relationships might be the answer to that as well - worth linking these two topics?
Comment #11
biohabit commentedWith regards to the tabular view, it appears at least with views 2.0 rc2 that you still can't sort on node reference fields. Is this possible?
Comment #12
yched commenteddid you read comment #2 above ?
Comment #13
biohabit commentedYes and no ability to have sortable node reference column emerged. I am using CCK rc7 and views rc2. I'm able to dynamically sort using the title and update date but nothing else.
Comment #14
karens commentedRead #3, add a relationship to the view using the nodereference field. Probably make it required to be sure you only get nodes that have a related node. Then add the field you want to sort on as a sort, like the node title. Once you have added a relationship to the view, when you add a sort you'll see an option to use 'no relationship' to use the title of the original node or use the title of the related node, so choose the option to use the title of the referenced node.
You can do the same thing with the userreference field to show user fields.
Comment #15
arhak commentedWhat about a site like drupal.org which identifies the issues by nid?
whouldn't be useful sorting by nid? (with/without relationship)
Comment #16
arhak commented@KarenS also when using table layout there is no need of any sort, rather sortable column are preferable, so after the relationship was created add the field and select the relationship
for instance:
a Project has the author user who created it, but also a userreference to a Project Manager
- to sort by author add a field User:author and 'no relationship'
- to sort by Project Manager add the SAME User:author BUT selecting the relationship previously created
Also note that any field can be added many times, each time using a different relationship (having an idea about SQL will help, so read the query and try to figure out the bijection between SQL and Views Control Panel)
Being an old SQL dog didn't figure it out the first time, because use to add the relationship expecting new field to become available, something like "User:author" & "User:author (field_project_manager)" making the difference between with/without relationship but as it didn't came up, never added the field again, so never saw the next screen asking for the relationship option (definitely this is an issue, either documentation or usability one)
Comment #17
moshe weitzman commented@arhak - Views1 used to add many fields like that and the list of fields became unmanageable. The Views2 way of a smaller number of fields plus a relationship is far more usable.
As for documentation, this is well covered in the relationships page in the Advanced Help index. There is even an example regarding comments and users. No documentation issue either.
Comment #18
arhak commented@moshe well... didn't know about Views1, but sounds fair, NEVERTHELESS a field could appear marked with a footnote (even better an advanced help link) stating that is a candidate field for several (or at least more than one) relationship alternatives.
As easy as: "User: name (*)" and a footnote/advanced help indicating why it's marked
As for documentation.. Are you sure? That was the first place where I returned when didn't figure it...
And yes you're right
But I read that (at least two times) and didn't catch the idea of you will be presented with a select box, always expected to be immediate while selecting the field, not in the next screen.
Certainly it's just a matter of being familiar with Views2, now was that my first need to relationship came up and I won't forget to RT!M.
But I insist on the documentation issue, since many relationships become implicit available it's kind of hard to figure out how does an SQL maps the UI, more when the UI comes through several steps of screens setup.
What I would expect the first time would be something like this
which advices me what will happen, so I remain calm knowing that missing config will be prompted afterwards.
Note: the advanced help of views is GREAT for newbies, for old Views1 users, and others, also I know the hard work it takes to create such a dedicated help. Moreover, I realize that the "Getting started" have been improved even more (I didn't saw it until right now)
Comment #19
karens commentedThis is all Views documentation and the way that Views handles things. Doing anything about documentation or adding asterisks to field names or anything else is outside the scope of what CCK can do, that is all done in Views. CCK does not have any control over the Node: Title field, even for the title of a referenced node, Views handles that. CCK only controls the nodereference field itself. And the documentation you're referring to is all Views documentation.
So this issue has gone way beyond anything that CCK can or will do.
Comment #20
arhak commentedsorry, the second part of my comment #16 started a discussion out of topic
I just replied according to #17, didn't realize which module
Comment #21
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.