Hello

I created a taxonomy using the cities of a country to present different places in each city.
Example: Country => cities => place1, place 2, place 3.
I created a view for the countries wich displays teasers of every place sorted by city.
I would like to group the places by city, to get something like that:

USA
---Chicago
------Place 1
------Place 2
---Los Angeles
------Place 3
------Place 4
------Place 5
...

The problem is that its displaying teasers so i can't choose "grouping field".

Can you help me please?

Comments

dman’s picture

I just hit this today and it's bugging me too.
I can 'sort by' my category, but not group on it. Hm.
I'm using display suite and I'm really happy with my teaser layouts so really don't want to rebuild the whole layout using just fields again.

[edit - it turns out that Display suite provides its own (limited) way of grouping in views, so my actual case is sort of solved. Still, I'm interested to see what can be done to make this work using normal displays]

drcho’s picture

I got the same problem, I think this is a new feature request...

spovlot’s picture

Seems to be fixed in a patch and the 7.x-3.x-dev build
#1469112: Allow to use fields on style plugins/row plugins without fields

WorldFallz’s picture

switch to a field based view style and display the teaser using the "content: body" field.

spovlot’s picture

Many people are using Display Suite or Entity View Modes to create various Content displays. Those can be pre-formatted and themed with all or some of the fields in the content type. These are much more reusable than a field based View.

While you suggestion to use the Content:Body is helpful if you are using a field based view, the ultimate solution is to use Content view with a specific view mode.

WorldFallz’s picture

i didn't see the followup comment regarding display suite-- i was simply answering the op which makes no mention of ds. in any case, looks like the fix was committed to views.

dman’s picture

Yeah, 'view modes' for teasers, or using the teaser tpl for theming is really lots more robust than selecting and rebuilding stuff using views fields each time. I have content types with lots of fields.
The tiny things become unmaintainable, eg you have to define the date format specifically in every instance and every display, so that making a global change later means a lot of room for error.

The status on that linked issue patch doesn't seem to be actually *applied* yet, but thanks for the link.
I should try it out, re-roll and see if it tests well enough to give it a nudge over there I guess.

.dan.

pixelwhip’s picture

Rather than use the body field, use the "Node: Rendered Node" field which will allow you to choose from any of your view modes. Make sure you select "Show complete entity" under the display option on that field.

This drove me nuts for a couple hours today while trying to properly group node teasers (created in Display Suite) by taxonomy term. Once I figured it out, it worked like a charm.

spovlot’s picture

Thanks pixelwhip. I updated the Views issue with this information.

lpeabody’s picture

This needs to be somehow sticked and made visible at the very top of this thread... This worked perfectly.

nano_monkey’s picture

I'm using views 7.x-3.5 and I found that if you show 'Content: Teaser' and then in your field settings, select the 'Force using fields' option, this will allow you to use GROUP BY - as the help text for this option says: 'If neither the row nor the style plugin supports fields, this field allows to enable them, so you can for example use groupby'. (just noticed someone earlier in the thread has pretty much pointed this out, but can't delete this comment. Gah).

khuramhb’s picture

Thanks so much for sharing. I was struggling finding GROUP BY option for Views where you show 'Content:Teaser', it really rescued me. Thanks once again.