Skip Navigation

[Resolved] Filter to Show Unique Values

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by laurieL 9 years, 2 months ago.

Assisted by: Waqas.

Author
Posts
#277852

I am trying to: Group View Results by Unique values.

I have a "City Events" Post Type with meta values for that cities' Country and would like to display a list of City Events sorted by Country, with the Country value displayed only on its' first occurrence. (ex:

Canada
-Toronto
-Winnipeg

Italy
-Milan
-Rome

USA
-Chicago
-Seattle

I feel like I need to use some nested views, but have not quite cracked the logic:

I have an outer-view to display all City Events, ordered by Country that in turn calls a sub-view to list the cities for that country.

I cannot figure out how to limit the outer view to unique values. Is it possible? Any direction will be greatly appreciated!

#278291

Waqas
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I will suggest to read following article, although it is around "How to group Views results by year and month" but it may help in your case too:

https://toolset.com/2013/10/how-to-group-views-results-by-year-and-month/

However, I will try improving the architecture. I suggest you create a custom Taxonomy for "country", register it to post type "City Events", then create a nested view:

1) parent view list all country
2) child view list all "City Events" under parent country

Here is a document about Views Inside Views – Display Nested Multidimensional Lists
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

Hope it helps.

#286515

I changed the data structure so cities belong to countries (as they should) and everything is swell now! thanks!

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.