afficher les sous-sous-catégories

More
13 years 4 months ago #16441 by dolly2
Bonjour,
J'ai une structure de ce type:
Code:
végétaux |_fruits |_ pommes |_ poires |_ conférence |_légumes |_ artichaut |_ poireaux |_ ...

je voudrais que l'affichage catégorie "végétaux" affiche le contenu de tous les végétaux...
si j'active "afficher les sous-catégories", les sou-catégories sons bien inclues mais pas les "sous-sous-catégories": j'ai les végétaux, les fruits, mais pas les pommes.

Y a t'il un moyen d'avoir les sous-catégories de manière récursive ?

merci merci !!

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

More
13 years 4 months ago #16442 by dolly2
testé avec 1.5.4 et 1.5.5, même problème...

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

More
13 years 4 months ago #16444 by micker
c'est normal
l'affichage ne fait pas le sous souscategorie pour des raisons de performance
désoler

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 4 months ago #16451 by dolly2
aie je m´ en doutais, apres avoir parcouru les forum. J´ ai une piste, mais en trifatouillant le code... Je posterai mes resultats. Y a t il moyen de contacter le dev pour lui suggerer ma proposition? Je vais de ttes facons essayer! Merci pour ta réponse rapide.

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

More
13 years 4 months ago #16454 by micker
n'hesite pas si tu trouve des choses je lui ferai passer ou on le mettra dans le bug tracker
Merci pour ta future participation

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 4 months ago #16465 by dolly2
Et voici...
Dans le fichier components/com_flexicontent/models/category.php

function _buildItemWhere( )
remplacer:
Code:
if(is_array($this->_childs)) foreach($this->_childs as $ch) $_group_cats[] = $ch->id;
par
Code:
$query = $this->_buildChildsquery(true); $this->_recursiveChilds = $this->_getList($query); if(is_array($this->_recursiveChilds)) foreach($this->_recursiveChilds as $ch) $_group_cats[] = $ch->id;

et remplacer la fonction function _buildChildsquery() par ceci:
Code:
/** * Method to build the Categories query * * @access private * @return string */ function _buildChildsquery(/*ajout*/$isRecursive=false) { $user = &JFactory::getUser(); $gid = (int) $user->get('aid'); $ordering = 'ordering ASC'; // Get the category parameters $cparams = $this->_category->parameters; // show unauthorized items $show_noauth = $cparams->get('show_noauth', 0); $andaccess = ''; // filter by permissions if (!$show_noauth) { if (FLEXI_ACCESS) { $readperms = FAccess::checkUserElementsAccess($user->gmid, 'read'); if (isset($readperms['category'])) { $andaccess = ' AND ( c.access <= '.$gid.' OR c.id IN ('.implode(",", $readperms['category']).') )'; } else { $andaccess = ' AND c.access <= '.$gid; } } else { $andaccess = ' AND c.access <= '.$gid; } } //ajout: $categories = array($this->_id); if ($isRecursive){ $thislevel = array($this->_id); do{ $query = 'SELECT id' . ' FROM #__categories AS c' . ' WHERE c.published = 1' . ' AND c.parent_id IN ('. implode(',', $thislevel) . ')' ; $this->_db->setQuery($query); $thislevel = $this->_db->loadResultArray(); $categories=array_merge($categories, $thislevel); } while (count($thislevel) != 0); } //fin de l'ajout $query = 'SELECT c.*,' . ' CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( \':\', c.id, c.alias ) ELSE c.id END AS slug' . ' FROM #__categories AS c' . ' WHERE c.published = 1' /* modifié*/. ' AND c.parent_id IN ('. implode(',', $categories) . ')' . $andaccess . ' ORDER BY '.$ordering ; return $query; }

il doit y avoir plus élégant, mais ca n'ajoute qu'une seule requête par niveau de profondeur, donc en terme de perf ca reste raisonnable !

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.302 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