core icon indicating copy to clipboard operation
core copied to clipboard

filter setting/rule 'NOT'

Open andreasisaak opened this issue 11 years ago • 7 comments

Proposal of a new feature: attribute 'NOT'. An example on the Darty-Website, there are products 'Exclusiv Internet'. If I want a list of all products in the store, I need a filter 'NOT' 'Exclusiv Internet'. Another example: All TVs without the feature '3D'.

https://github.com/MetaModels/bundle_attributes/issues/1

andreasisaak avatar Jan 20 '14 19:01 andreasisaak

You do not want an attribute but a new filter setting and rule. Please file a corresponding feature request in the "core" repository.

Comment from @discordier

andreasisaak avatar Jan 20 '14 19:01 andreasisaak

Filterregel NOT ist vorhanden - das Issue kann m.E. geschlossen werden

zonky2 avatar Dec 28 '15 13:12 zonky2

Sicher? Es geht hier um FE Filter, nicht backend conditions.

discordier avatar Dec 28 '15 18:12 discordier

dann habe ich https://github.com/MetaModels/bundle_attributes/issues/1 vielleicht auch nicht kappiert...

zonky2 avatar Dec 28 '15 19:12 zonky2

Ist doch ganz einfach: Du hast Videos in verschiedenen Kategorien -> Thriller / Kinderfilme / Action. Man möchte jetzt alle Filme, die KEIN Thriller sind -> NOT Thriller. Dafür bräuchte man also einen Speziellen Filter, der das so macht (ich glaube mit einer extra Checkbox im Frontend wäre etwas blöde, da man dann erst mal Thriller auswählt und dann das nicht. Bei sofortiger Aktualisierung würde man da ja dann erst alle Thriller bekommen und dann erst auswählen können, das die eben nicht angezeigt werden sollen).

MacKP avatar Dec 29 '15 05:12 MacKP

o.k. - verstanden...

Man könnte sich verschiedene Implementierungen vorstellen z.B.

  • Checkbox "Filterergebnis negieren"
  • Filterregel mit Parameter "Nur für FE-Ausgabe einsetzen" - dann benötigt man noch eine eigene SQL-Filterregel
  • mit OR-Filterregel - geht schon jetzt s.u.

OR-Filterregel wie Screenshot einbauen und bei OR-Regel Checkbox "Nach erstem Treffer beenden" setzen

shot23

und SQL

SELECT id 
FROM {{table}} 
WHERE abteilung IN (
  SELECT id
  FROM mm_abteilung_anders
  WHERE alias != {{param::get?name=abteilung}} 
  OR ({{param::get?name=abteilung}} IS NULL)
)

siehe Beispiel "V2" http://e-spin.de/contao-metamodels.html

zonky2 avatar Dec 29 '15 14:12 zonky2

im Handbuch aufgenommen: http://metamodels.readthedocs.org/de/latest/cookbook/filter/exclusion.html

zonky2 avatar Dec 29 '15 21:12 zonky2