FAQ template

More
11 years 2 months ago #32618 by ggppdk
Replied by ggppdk on topic FAQ template
First,
categories of your items that are outside current category subtree have NOT been retrieved !!

Second,
your code keeps reseting subcategory items and keeps adding only last one to be added

Try replacing, in original template code:
Code:
$items = & $this->items; for ($i=0; $i<count($items); $i++) : foreach ($items[$i]->cats as $cat) : if (isset($cat_items[$cat->id])) : $cat_items[$cat->id][] = & $items[$i]; endif; endforeach; endfor;
with:
Code:
$items = & $this->items; $need_query_cats = array(); for ($i=0; $i<count($items); $i++) : foreach ($items[$i]->cats as $cat) : if ( !isset($cat_items[$cat->id]) ) : $need_query_cats[] = $cat->id; endif; $cat_items[$cat->id][] = & $items[$i]; endforeach; endfor; $db = JFactory::getDBO(); $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.id IN ('.implode(",",$need_query_cats).')'; ; $db->setQuery($query); $extra_cats = $db->loadObjectList('id');

and
Code:
<?php global $globalcats; $count_cat = -1; foreach ($cat_items as $catid => $items) : $sub = & $sub_cats[$catid];
with:
Code:
<?php global $globalcats; $count_cat = -1; foreach ($cat_items as $catid => $items) : if ( isset($sub_cats[$catid]) ) $sub = & $sub_cats[$catid]; else $sub = & $extra_cats[$catid];

NOTE: i have not tested this

Regards


-- 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
11 years 2 months ago #32629 by Pitou
Replied by Pitou on topic FAQ template
YEAH !
Without any test ?
It seems to works perfectly !
Many thanks for this and for all your work !

++

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

More
11 years 2 months ago #32667 by micker
Replied by micker on topic FAQ template
tu nous tien au courant si ca marche ?

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
11 years 2 months ago #32672 by Pitou
Replied by Pitou on topic FAQ template
Salut

Ca marche et c'est génial. A mon humble avis, c'est vraiment un truc à implémenter dans les templates par défaut : la capacité de pouvoir afficher ainsi pour une catégorie principale, par groupe de catégories, l'ensemble des articles liés à la fois à la catégorie principale et à d'autres catégories en dehors de la catégorie principale.

Il y avait des redondances de catégories (par exemple, si tu lis un article à la catégorie principale, puis à d'autres catégories, il est d'abord repris sur la catégorie principale, puis ensuite on reprend l'ensemble des catégories qui sont liées). Donc au niveau de l'affichage, tout d'abord l'ensemble des articles de la catégorie principale, puis toutes les catégories liées.
j'ai ajouté deux lignes de codes pour supprimer le cas de la catégorie principale, puis pour ne pas reprendre en temps que catégories les articles présents dans la page d'accueil.
J'ai mis en "dur" le numéro id de la page d'accueil. Je ne sais pas s'il existe une variable globale pour définir l'id de la catégorie page d'accueil, mais comme le nom de la catégorie va changer en fonction de chaque personne, créer une regex pour trouver un nom dont on n'est pas sûr...
Bref, je l'ai mis en dur.
Sûrement que GGPPDK a une astuce pour trouver cela facilement.
Bref, ci-joint le fichier faq en question, avec les modifications et une capture de l'affichage, sur une seule colonne (marche aussi bien avec 2 colonnes).

And yet in english :
It's works great. I think it would be a good feature for the futures officials templates.

There where redundancy categories (for example : the first main categorie displayed all the articles, and after they were displayed with others categories. I mean it's not usefull to display this articles grouped together). I've made also a categorie for the homepage and I didn't want them to be displayed in my page.
So I added two lignes to ggppdk code, but I had to write the homepage categorie's id, cause I dont know if there was a variable for this. (And the Regex would works only if the homepage categorie were different from mine).
Attachments:

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

More
11 years 2 months ago #32685 by micker
Replied by micker on topic FAQ template
Merci beaucoup pour le retour !

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.

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