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.