Why can't make Views' tables sortable on CCK columns?
Doesn't CCK support sortable columns for Views (table layout).
I already have many tables with Views, and every column is sortable except for CCK's
What am I missing?

Comments

karens’s picture

Status: Active » Fixed

Most CCK fields are sortable. They work the same way others do. To use table sorting, mark the field as sortable. Or if not using a table, add a sort to the view. There may be some CCK fields where sorting won't work right (nodereference and userreference are examples), and if so they won't have that option, but all others do. Nodereference and userreference can be sorted, too, but you do it by adding a relationship to the view and then selecting the field in the referenced node that you want to sort on.

arhak’s picture

Status: Fixed » Closed (fixed)

The answer I was looking for: relationships.
I suspected that from the start, but all the cck fields wouldn't require a relationship, wouldn't?
Well, it turns out that in the cases I was trying they do.
I created many views with cck fields like: userreference, nodereference, content_taxonomy
so #274909: Views sorting for userref / noderef

PS: thanks anyway

zbricoleur’s picture

Nodereference and userreference can be sorted, too, but you do it by adding a relationship to the view and then selecting the field in the referenced node that you want to sort on.

KarenS, could you explain that a little more, please? How does one add a relationship to a view?

yched’s picture

When editing a view, along with 'fields, 'filters', sorts, 'arguments', you have a 'relationships' section.
Add your noderef field as a relationship. Then each time you add a field to your view (say, 'Node created time'), you can specify that you want this field to apply to the nodes in the noderef field.

For more details, see Views help pages, available when you install the advanced_help module

zbricoleur’s picture

Thanks yched. I just noticed this thread was about 6.x. I'm still on 5.x. I think I found the problem...