. If I select the parent Item as a filter while viewing the map with the leaflet widget, it won't show any  of the contents with that parent item. It doesn't matter if the content entry has only a leaf or a leaf AND the parent item, or only the parent item, none of them will show.

thanks!

 

Comments

indigoxela's picture

Hi geoma,

hm... I'm not quite sure, what "parent" means in that context.

Is it a taxonomy term? Or a related node type?

The map will only show geo data from the field configured via "Data Source".

indigoxela's picture

Still trying to understand: you have this view and an exposed form on it, right.

And you have two independent taxonomy terms and try to filter by them?

Or is this a hierarchal vocabulary? Hmmm, no, can't be it.

If you want to filter by two vocabs simultaneously, it's necessary that both criteria fit - is that, what you're after? So only nodes show up, that have both terms...

Sorry for not being clear. 

I have this view and two exposed filters on it.

I am trying to show different places on the map. These places are called "institutions".

They have a field which points to this "category" hierarchical vocabulary of taxonomy terms (which is not working), which category(ies) apply to each content. For example, If it is a school (Educación Waldorf is the parent term), it can have Kinder (kinder Garden) or Primary education (educación básica), which are leaves of this parent term.

This is what is not working.

The other is the "region", that can relate to "state" (as in geographical division), This is a a field inside the content type comuna,  and is linked to the institution content by the field "comuna" (think of it as county),  I'll show you through screenshots.

I want users to be able to filter through any of these filters, or both if they like.

Thanks for your help!

 

indigoxela's picture

Hi geoma, no need to excuse. I think, now I got it (more or less).

Your problem doesn't actually have much to do with the Leaflet module, but you struggle with the combination of hierarchial vocab filter (a beast on its own) and a filter on a list field in a related entity.

Tricky...

Terms parent/child filtering can be dealt with, but I belief, you need a relationship to the vocabulary to use the hierarchy in the exposed filter. And use that relationship in your filter instead of the field value.

However, another relationship might cause duplicates, which you'd have to catch with aggregation. (Not sure, though)

The relationship on the other content type seems fine.

But you're still dealing with a complex setup, which needs several tweaks and might be quite some challenge - depending on how familiar you are with views filters on relationships.

It's not possible for me to get more specific with my suggestions, as the setup's quite complex. But I hope my hints help a bit to dig further.

Thanks @indigoxela!

It works (at least as a start): Now I can use the filter... BUT:

I get, as you predicted, a lot of duplicates (One node appears 7 times, other 5 times,  other 3 times.

I guess it has to do with them having more than one category.

By "agreggator, I guess you mean using this plugin: 

https://backdropcms.org/project/views_aggregator ?

ok I think I got it. Aggregation is an option on the "other" section.

But there is also an option to avoid duplicates on the filter criteria.