Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
stacysimpson CreditAttribution: stacysimpson commentedWhoops, nevermind. I see that I have 'grouping' set.
Comment #2
stacysimpson CreditAttribution: stacysimpson commentedWell, looks like sorting by link title is still not available by default. We should make this a configurable option.
Comment #3
stacysimpson CreditAttribution: stacysimpson commentedTo clarify, I'm referring to click sorting of table columns. The built-in view sorting method does sort by link title.
Comment #4
silentway CreditAttribution: silentway commentedConfirmed.
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."
Comment #5
dropcube CreditAttribution: dropcube commentedComment #6
TravisCarden CreditAttribution: TravisCarden commentedsubscribe
Comment #7
thomasmurphy CreditAttribution: thomasmurphy commentedsubscribing
Comment #8
lindsayo CreditAttribution: lindsayo commentedIt'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.
Comment #9
silentway CreditAttribution: silentway commentedA 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...
Comment #10
dqdThis 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.
Comment #11
dawehnerWell 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.
Comment #12
dqdHm ...
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.
Comment #14
dawehnerAt 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.
Comment #15
DamienMcKennaThank you all for your efforts, but I'm sorry to say that the D6 version is no longer supported.