Multiselection attribute filtering

Author Message

Zdenek Ziegler

Tuesday 06 December 2005 8:43:47 am

Hi,
we have a problem with eZselection datatype with multiselection.
Because we can't use standard attribute filter, we want to implement enhanced filter for multiselect in folder view with site limit. But we need to use it together with normal attribute filters, so its impossible to use search. Is it possible to use extended filter for it and together with normal filter? Or exist any other solution? Filtering with if statement when looping the results would be to slow due to many items.
Thanks for your help,
Zdenek

Kristof Coomans

Tuesday 13 December 2005 5:56:08 am

I think you can filter eZSelection with multiselect by using 'like':

'attribute_filter',array('or',
                              array('yourclass/yourmultiselectionattrib', '=', '5'),
                              array('yourclass/yourmultiselectionattrib','like', '5-*'),
                              array('yourclass/yourmultiselectionattrib','like', '*-5' ),
                              array('yourclass/yourmultiselectionattrib','like', '*-5-*' )
                             )

But then you can't filter with other conditions that have to ('and') match.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Fabricio Guerrero

Wednesday 25 January 2006 7:07:00 am

Hi,

Just in case anybody is still in need of this.. i made a work aroud for a similar situation...

basically we also had a multiselection attribute that needed to be filtered but with norma attribute_filter wasn't working... solved this just by doing a text search in the attribute.. if you perform a text search it doesn't matter if 1 or all the Options were selected.. as long as it finds the text it will bring it back...

Regards,
Fabricio

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...

Fabricio Guerrero

Thursday 03 August 2006 2:37:48 am

Hi,

As I mention previously we had a situation where we had an extensive ezSelection MultiSelect attribute that had to get filtered and by using attribute_filter it wasn't solving it. I later implemented:

{def $search=fetch( 'content', 'search',
hash( 'text', $strCat,
'class_id', 25,
'class_attribute_id', 226,
'offset',$view_parameters.offset,
'limit', $numberOfObjects,
'attribute_filter', array( array( 'article_issue/top_story', '<>', 1 ) ),
'sort_by', array( 'modified', false() )
))}

This search helps me filter the MultiSelect and get all the Articles that match the Category.

Now do to this clients new request(Upgrades to the site) he wants a CheckBox added to thses Articles that also will have to be filtered in the above fetch. I've been trying to add the attribute_filter to my previous fetch and obviously it doesn't work as it's not supported by this type of search. see: http://ez.no/doc/ez_publish/technical_manual/3_7/reference/modules/content/fetch_functions/search

Has anyone done a MultiSelection search/filter AND filtered other attributes at the same time. Is this even possible?

Fabricio

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...

Xavier Dutoit

Thursday 03 August 2006 2:48:32 am

Hi,

Functionaly similar to multiselection is enhanced object related filter (option check box). Then you can mix with other filter on attributes.

X+

http://www.sydesy.com

Fabricio Guerrero

Friday 04 August 2006 3:09:22 am

Hi Xavier,

Thanks for your reply.

The checkbox solution is not possible do to that this client has over 30categories listed in the MultiSelection Attribute and checkboxes would just get too messy.

Fabricio

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...

Xavier Dutoit

Friday 04 August 2006 9:44:04 am

Hi,

Not sure we understood each other. I'm talking about this extension:
http://ez.no/community/contribs/datatypes/enhanced_objectrelation

If you don't like check boxes, you can go for the multi list (just an option on how to display it). I haven't been able to explain to my users how to make ctrl clic myself and I don't think it take much more place, but that's up to you.

X+

http://www.sydesy.com

Fabricio Guerrero

Monday 07 August 2006 10:44:14 am

Hey,

Just saw your reply.. thanks.. I'll have a look at your extension and let you know the outcome.

Thanks,
Fabricio

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 00:44:49
Script start
Timing: Jan 30 2025 00:44:49
Module start 'layout'
Timing: Jan 30 2025 00:44:49
Module start 'content'
Timing: Jan 30 2025 00:44:49
Module end 'content'
Timing: Jan 30 2025 00:44:49
Script end

Main resources:

Total runtime0.0146 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1406151.2109
Module start 'layout' 0.00510.0021 739.351636.6641
Module start 'content' 0.00730.0056 776.0156102.2813
Module end 'content' 0.01290.0016 878.296945.9922
Script end 0.0145  924.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.7154140.0002
Check MTime0.00117.3864140.0001
Mysql Total
Database connection0.00096.118610.0009
Mysqli_queries0.001913.130930.0006
Looping result0.00000.068610.0000
Template Total0.00139.110.0013
Template load0.00096.440410.0009
Template processing0.00042.638610.0004
Override
Cache load0.00074.597510.0007
General
dbfile0.00128.523580.0002
String conversion0.00000.042540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs