Project:Index
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Xano
Status:active

Issue Summary

Both #668440: Add filters to layers and #650520: Translations for every entity require a way to set filters for layers. This issue is dedicated to creating a way to store information about global and layer-specific filters.

Comments

#1

Minor first stab.

AttachmentSize
layer_filter_api_00.patch 1.52 KB

#2

Title:Filter API» Conditions API
Assigned to:Anonymous» Xano

Technically filters are now entity_type only, while filters, global conditions and conditions to find children for parent entities are now called "conditions" as you can see in $index->conditions and $indexLayer->conditions.

This patch has three groups of conditions:
1) global, which are conditions that apply to all layers, like the language that is set only once for the index.
2) filters where configuration settings from entity type-specific filters should be put. See #668440: Add filters to layers for more information on that.
3) hierarchy, which contains the condition to find find child entities for a parent. This array may only contain ONE item or the code will break. This isn't a good thing, so we'll need to come up with a solution for that.

hierarchy needs to be used at all times to generate a correct entity hierarchy. global is optional, as not all entity types can be translated, for instance. filters is optional as well, logically because not all entity types may have filters defined.

a) This can work, but I'm still not content with how we store this data. It looks too rigid too me, not flexible enough.
b) Allowing multiple conditions in hierarchy will break stuff, which is tricky. Shouldn't be possible.

Any input is appreciated :)

PS: this patch isn't fully functional. Not all entity types have been updated and the ones that have are still buggy. It's only useful to take a look on the initial approach.

AttachmentSize
layer_filter_api_01.patch 13.31 KB

#3

This patch has just been committed. It allows more advanced where clauses for queries, which is necessary for this issue, bur for others as well.

AttachmentSize
advanced_query_conditions_00.patch 7.75 KB

#4

can u please provide any example about how to aplly a filter (by vocab) to existing block index?

#5

This is an API, which means it is of no use to end users. There is currently no way to filter items and there won't be any way to do so for at least a couple of weeks.

#6

it's ok.

When conditions feature will be finished i'll back to this module (i really like it). But for now i have to use advanced taxonomy block.

good luck.

nobody click here