Forums / Developer / Multiselection attribute filtering

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...

eZ debug

Timing: Jan 18 2025 01:12:20
Script start
Timing: Jan 18 2025 01:12:20
Module start 'content'
Timing: Jan 18 2025 01:12:20
Module end 'content'
Timing: Jan 18 2025 01:12:20
Script end

Main resources:

Total runtime0.3284 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 587.7344180.8281
Module start 'content' 0.00860.0067 768.5625106.0078
Module end 'content' 0.01530.3131 874.5703534.5469
Script end 0.3284  1,409.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00401.2135200.0002
Check MTime0.00140.4223200.0001
Mysql Total
Database connection0.00100.292910.0010
Mysqli_queries0.270482.33341410.0019
Looping result0.00180.53401390.0000
Template Total0.312795.210.3127
Template load0.00080.242310.0008
Template processing0.311994.970310.3119
Override
Cache load0.00060.177510.0006
Sytem overhead
Fetch class attribute can translate value0.00080.252410.0008
XML
Image XML parsing0.00030.081310.0003
General
dbfile0.00551.6872200.0003
String conversion0.00000.002130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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