Filtres catégorie

More
9 years 11 months ago #51450 by juansolos
Filtres catégorie was created by juansolos
Bonjour,
j'ai un élément de menu categorie mycat.
Cette catégorie ne contient aucun item mais des sous catégories.
Main
-mycat
--mysubcat
--mysubcat2

J'affiche un ensemble de filtre dont le filtre catégorie.
Mon filtre ressemble a ceci :
categories
mycat
-mysubcat
-mysubcat2

1/COmme mycat ne contient rien, si il est sélectionné ca donne rien. Est il possible de le virer pour ne garer que les sous categories?

2/Est il possible de renommer "catégories"? En effet suivant les types d'item le champ catégorie pourrait s'appeler recettes, cuisinier, avions, ...

Merci

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #51454 by ggppdk
Replied by ggppdk on topic Filtres catégorie
Hello

yes the categories filter needs improving

but i am not sure by reading the translation

-- do you speak of the fact that when you select a category the SUB-category items are not included

so we need a parameter in categories fields to allow including sub-category items when selecting a category ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #51458 by juansolos
Replied by juansolos on topic Filtres catégorie
The menu item display items from the sub cat. That is fine.
I get trouble with the filter.
If i select the category that not contain item (only sub cat)
I get nothing.
The menu item allow sub cat item and the category conf allow sub cat item.

I have this in my filter :
categories
mycat
-mysubcat
-mysubcat2

The menu item display mycat.
That display all items from subcat.
If i select mycat in the filter i get no item.

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #51482 by ggppdk
Replied by ggppdk on topic Filtres catégorie

juansolos wrote: If i select the category that not contain item (only sub cat)
I get nothing.


Yes sub-category items are not included



-- so it is what i suggested above, we need new parameter to enable including sub-category items, right ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #52419 by juansolos
Replied by juansolos on topic Filtres catégorie
Hello,
yes.
It should be nice to get items from the subcat.

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #52430 by ggppdk
Replied by ggppdk on topic Filtres catégorie
Hello

this should be in next FLEXIcontent version, you can try to apply it to current version:

do NOT make any other changes or hacks, it is important that you are able to upgrade:

in file

components/com_flexicontent/models/category.php

Replace:
Code:
$query = 'SELECT itemid' . ' FROM #__flexicontent_cats_item_relations' . ' WHERE catid IN ('. implode(",", $values) .')'; ; $filter_query = ' AND i.id IN (' . $query . ')';


with:
Code:
global $globalcats; $cparams = $this->_params; $display_subcats = $cparams->get('display_subcategories_items', 0); // include subcategory items $query_catids = array(); foreach ($values as $id) { $query_catids[$id] = 1; if ( $display_subcats==2 && !empty($globalcats[$id]->descendantsarray) ) { foreach ($globalcats[$id]->descendantsarray as $subcatid) $query_catids[$subcatid] = 1; } } $query_catids = array_keys($query_catids); $query = 'SELECT itemid' . ' FROM #__flexicontent_cats_item_relations' . ' WHERE catid IN ('. implode(",", $query_catids) .')'; ; $filter_query = ' AND i.id IN (' . $query . ')';




-- the above code will use the "include subcategory items" parameter of current category (OR menu item)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.420 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline