I have a view setup to display information in table format; however, there is no checkbox available to tell the system to allow users to sort by the link field. (NOTE: I would like to allow people to sort by the link title, not the URL.) Has anyone else seen this behavior?

Comments

stacysimpson’s picture

Whoops, nevermind. I see that I have 'grouping' set.

stacysimpson’s picture

Well, looks like sorting by link title is still not available by default. We should make this a configurable option.

stacysimpson’s picture

To clarify, I'm referring to click sorting of table columns. The built-in view sorting method does sort by link title.

silentway’s picture

Version: 6.x-2.5 » 6.x-2.6

Confirmed.

To further clarify: A field of type "link", when shown in a View, will sort by the URL rather than by the title. Expected behavior should be to sort by Title.

Additional request: add option to sort by URL or Title.

But for me, it does not matter if the view column is set to be click-sortable. (under Basic Settings, Style (Table), "gear icon" options) Either sortable or not, it still sorts by URL.

Confirmed with the following configuration:

Drupal 6.13
Link 6.x-2.6
CCK 6.x-2.4
(rest of the install is acquia-drupal-1.2.15.5086)

other settings:
URL is set as optional in the field's global settings.
Link Title is set to "required."

dropcube’s picture

Title: Unable to sort by link field in Views 2 » Allow to sort by link field in Views 2
Category: bug » feature
TravisCarden’s picture

subscribe

thomasmurphy’s picture

subscribing

lindsayo’s picture

It's a bummer this is still an issue, I'm having trouble with it, too. I will have to try to think of what to do for a workaround for now.

silentway’s picture

Version: 6.x-2.6 » 6.x-2.9

A complicated workaround:

We'll call the field in question "field A".
Add another URL field "field B." Set field B to "Exclude from display" and order it in your view before field A. On field A, "Output this field as a link", set the "link path" to a token for field B like this: [fieldB_url].

At least that's how I remember it... I hope I got that right... YMMV...

dqd’s picture

Project: Link » Views (for Drupal 7)
Component: Code » exposed filters
Category: feature » support
Priority: Normal » Minor

It's a bummer this is still an issue, I'm having trouble with it, too. I will have to try to think of what to do for a workaround for now.

This is rather more a support request for views / exposed filters tweeking and handling the link field, than for the link field module itself, which is here for storing and validating link data in custom fields in the first place.

please redefine the issue. I got to move it.

dawehner’s picture

Project: Views (for Drupal 7) » Link
Component: exposed filters » Code

Well the link module could for example do this logic in a custom field handler.
Therefore it would have to override click_sort(), then join to the other node table and sort by the title.

dqd’s picture

Status: Active » Postponed (maintainer needs more info)

Hm ...
not sure if I understood it all right here, but link module provides already sorting for unlimited values at the node/add scenario. But how can the link module sort anything on the display's side of the world?

And why such a display task so closely intertwined to a storage module in a modular designed framework? Doesn't sound that druplish to me ... but maybe it's all language strain since english isn't my native lang.

dawehner’s picture

At least the issue here is definitive not about a general integration of cck into views.
A general integration would sort by the actual value(the nid) and not the node title.

DamienMcKenna’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (won't fix)

Thank you all for your efforts, but I'm sorry to say that the D6 version is no longer supported.