i searched a lot on this site, i found different articles about grouping in views, but it was either for old versions or non applicable. i ask sorry if i make anyone repeat.
I have multiple article entries, and some of them have exact same title (but different body).
I would like to have a VIEW similar with glossary, but where the Nodes are grouped by Title, instead of being listed individually.
Where should i be looking at?
i looked into "Using Views templates" but i am too new here to understand exactly what i should be doing.
thanks for helping!
Comments
Comment #1
jacopo3001 commentedi think i found it, but still cannot make it work:
i went on: selected Views: basic settings : style : settings : group by...
selected TITLE, but the 2 nodes with same title are still listed separately
am i missing something?
Comment #2
merlinofchaos commentedIn the settings for either the style (the gear to the right of the 'Style' setting in the UI), there should be a 'grouping field'. Select your title there and it should automatically group by that field.
Comment #3
jacopo3001 commentedthank you for taking time to reply, and i am sorry to reopen this, but the method described on comment #2 is exactly the same one i use in #1, which is not working, or better, is not obtaining the desired result:
please check
http://lsp.alacity.com/?q=glossary/c
as you see now the VIEWS created 3 groups, one for each word.
But what i wanted was to have the 2 'ciao' grouped together.
to speak in basic sql language, i am looking for the same output i would get with:
SELECT count(*) as total, title FROM `node` group by titleHow can i do that?
thanks again
Comment #4
merlinofchaos commentedThat's because you've got the title as a link to the node. That HTML is part of the string which is what's being considered for equality. They are not technically the same string, therefore don't group. Don't set the title to link. Instead, add a second title field; one that links, one that doesn't link. Use the not linking field for grouping and the linking field for display within the group. Set the not linking field to exclude.
This is a perfect example of how you can't have too much information in a request, since there was no way for me to know what you were doing until I actually saw it.
Comment #5
jacopo3001 commentedthanks, it works.
but still is not what i was looking for.
what i would like is to have the same output i would get with:
SELECT count(*) as total, title FROM `node` group by titlein a list would appear like:
when i click CIAO i would go to a page where all CIAO's entries are listed.
is this something we can using VIEWS controls? or if not, where should i modify?
thanks again
Comment #6
merlinofchaos commentedAhh. What you want is a special kind of view called a summary view.
Add the Node: Title argument to your view.
Set the default action to 'summary, sorted ascending'.
Upon clicking update, you'll get the settings for the summary style; set it to the normal style, and then in the options tell it to include the record count. That should get you what you want, there.
Sorry about that, totally misunderstood what it is you were really trying to accomplish. My fault, since you did say in there.
Comment #7
jacopo3001 commented:( still not...
i added Arguments> node:tile
selected Summary, sorted ascending.
update
List style: List or Unformatted (i tried both, as i dont have NORMAL as you said)
then: Display record count with link
still wrong.
maybe i am missing something again? :S
you wanna try?: jalabiso/test123
if we make it, i promise i will write a full tutorial about it, but you need to accept my english :)
Comment #8
jacopo3001 commentedi tried something, it fixed something but created problem elsewhere, i am lost:
http://lsp.alacity.com/?q=glossary
this is how it should look
but if i click on one letter (eg: C), i should 'filter' the same view for C only.
while it doesnt happen!
to obtain this i did:
arguments> node : title
title : %1
Summary, sorted ascending
Glossary mode: false
i am not sure if i am getting closer or not.
Comment #9
merlinofchaos commentedSorry, you ended up on the wrong style. When you set an argument to have a 'summary' there should be a summary style that appears right beneath the argument in the list.
Comment #10
jacopo3001 commentedi think understanding where the problem is (style of list is not a problem at this stage):
SUMMARY View is what i need, the problem is that SUMMARY VIEW only happens where there is not arguments.
so, http://lsp.alacity.com/?q=glossary/ is perfect, just the way i want it.
but when i click C, i would like to see the exact same type of list, just filtered by C.
but this apparently cannot happen, because when i click C i actually passing an argument, so SUMMARY VIEW will not be called (as it only works in case of missing arguments).
am i supposed to face this problem with another approach?
Comment #11
merlinofchaos commentedThe problem there is that you modified the existing argument rather than adding a new one, I think, because multiple arguments will stack and this view should have done that.
Here's a modification to the original glossary view that comes with Views that does what you want:
BTW, adding the glossary complication to the top threw me for a loop at first. One thing at a time.
Comment #12
jacopo3001 commentedPlease dont hate me... where should i change this?
should i do it directly on mysql, as i dont find any place to edit this in the interface...
Comment #13
jacopo3001 commentedgreat! i made it work.
( i couldnt copy your code but it gave me inspiration)
in Arguments, i will add node:title twice. the first one will handle the view for /?q=glossary , with no args.
the second will handle /?q=glossary/c
i am still not sure why is that, but it works.
as soon as i figure out it's meaning i will write a small tutorial, as promised.
thank you soooo much for all your time, hope i can pay back sometime
Comment #14
merlinofchaos commentedOh, I'm sorry, this is another case of me being used to people undesrtanding imports.
That cdoe was an exported view; you cut and paste it into the 'import' textbox and it will create teh view on your system. That's how you share views across systems.
Arguments work like this:
First argument:
Is argument present? If no, 'do default action'. In this case, make a summary view.
If yes, 'filter view' -- now only nodes with a 'c' are present.
Second argument:
Is argument present? If no, 'do default action'. This is another summary view.
If yes, filter view -- now only nodes with a 'c' and that match the title are present.
Comment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.