Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.0-rc1
Component:
Views Data
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Aug 2010 at 18:13 UTC
Updated:
24 Sep 2011 at 18:41 UTC
Jump to comment: Most recent
I am trying to set up Glossary view. By default, it takes node titles and sort by them. OK, it works.
But, I need to sort (A, B, C...) by values from cck field. Views normaly sees this field, I add this field as argument, set it as normal glossary view. But it doesnt work.
It quiet works, but if Provide default argument - "a" is set, then it doesnt show anything.
Comments
Comment #1
esmerel commentedCan you provide an export of the view?
Comment #2
eL commentedIf Summary, sorted ascending is set, it works, but after clicking on letter in header, it shows list of nodes beginning with selected letter, but header with letters is not present now.
If Provide default argument is set, nothing is displayed.
Comment #3
esmerel commentedWhen adding requested detail, please be sure to reset the issue to 'active'
Comment #4
iamjon commentedHi eL,
Did you ever find a solution to your issue? If yes please update the post so others can benefit.
I tried importing your view but it didn't work.
What kind of cck fields are we talking about. Can you provide step by step replication instructions? (Try to make it as generic as possible.)
Comment #5
iamjon commentedChanging status
Comment #6
eurekaloop commentedIn addition to Drupal 6, when using the glossary view option on Drupal 7 and Views 7.x-3.x-dev, the view is automatically sorted by title (ascending), and setting any other sort functions do not affect/over-ride this. I tried sorting by both taxonomy and post date and both are over-ridden by the title sorting.
Not sure how to go about fixing this, but in the meantime I am linking to the view's page and appending "?order" to the URL and that seems to allow my selected sort options to display properly.
Comment #7
iamjon commentedeurekaloop,
you are a bit of off topic. el opened a specific support request. please feel free to open a new a thread.
Comment #8
eurekaloop commentedI apologize, but it sounded like the same issue to me.
El said, "But, I need to sort (A, B, C...) by values from cck field. Views normally sees this field, I add this field as argument, set it as normal glossary view. But it doesnt work. "
So it sounds like it will not allow him to sort by anything other than title when choosing a glossary view. He wanted it sorted by a CCK field, but it only sorted by title (if I read his entry correctly). In my case, I tried to sort by taxonomy term, or even post date, but it still retains the default sort-by-title. So it sounds like I am experiencing the same phenomenon, and it may have nothing to do with CCK fields but with the default title-sort.
Was I wrong in following up here? Would it be better to post the same problem in a separate request?
Comment #9
eL commentedSorry, it´s a while and I am not sure now, how did it, but I did it. CCK field can be an argument. May be, it is needed, to be in Fields presented too.
Comment #10
eurekaloop commentedThanks, eL - I'll try that and see if it works.
:)
Comment #11
varunity commentedConfirmed. It works great. I used it here: http://patwa.org for an alphabetical sort. In my case "Node Title" was the argument so that with the " Glossary mode" setting I was able to limit the length to 1 (meaning the views argument is essentially the starting letter for words, eg http://patwa.org/letter/a )
Comment #12
dawehnerMark as fixed based on #11
Comment #13
eurekaloop commented@varunity - Well, of course sorting by node title works - that's the default, as I had stated above. Its getting it to sort by other fields (such as CCK fields) that seems tricky. ;)
Since my last post, I have managed to get it to sort by the taxonomy term. However, where it still fails is if you try and sort by a CCK field that is based on a taxonomy term. Since the new version of Drupal doesn't let you associate nodes directly to a taxonomy term, we are required to choose an existing term using the "term reference" option for our custom content types. It is this "term reference" field that does not work with default sorting. Not sure why, but using the direct taxonomy term instead is working for me.
So, to narrow down this little quirk, trying to sort by a CCK term reference (rather than a standard CCK text field) is not working.
Comment #14
merlinofchaos commentedWhen you say sorting 'it' what do you mean exactly?
A glossary view is actually the composition of two views. There's the 'summary' view which represents the glossary, at the top, Summary views ignore the normal sort criteria and sort only by the field that they're summarizing. So in the normal case, that's node: title.
Then there's the primary view, which should sort normally. Unless you're using a table or something, in which case you could end up having the tablesort override the normal sorting.
Now, with this explained, can you be more precise in what is happening? Can you describe what it is you're getting versus what it is you're expecting (and why you're expecting it)?
Comment #15
merlinofchaos commentedOh, and I see that the glossary view, by default, is a table style, and it's using tablesort, and the default sort is by nid. Check the style configuration for your table. It's almost certainly set to override normal sorting if tablesorting is in use.
Comment #17
Anonymous (not verified) commentedCreating a glossary based on a CCK field still doesn't work for me (version 6.x-2.12). When I break it down I see that the necessary JOIN to the content type table isn't present in the resulting query. The alias is used in the SELECT part of the query, resulting in a SQL error (watchdog) saying the field doens't exist.
Using hook_views_query_alter and adding the table that is needed, fixes this problem. But I think, correct me if I'm wrong, this is a bug in views?
Comment #18
Pav-2 commentedI've got the same issue, using taxonomy term for now but would be good to see if anyone got this sorted.
Thanks
Comment #19
momeee_2 commentedI have the problem i have enabled the glossary module and add a filter for the specific node type but it doesn't work properly when I click on alphabets it doesn't show the node please check this http://dev.pajhwok.com/glossary
Comment #20
iamjon commentedmomeee_2,
please open a new issue and follow the issue guidelines. This issue has been fixed.
http://drupal.org/node/571990
Comment #21
varro commentedI got it. I found a solution for this issue that can be found here http://foro.varro.es/viewtopic.php?f=25&t=66
Comment #22
dawehnerUpdate status.