[résolu] Afficher des articles relatifs

More
12 years 8 months ago - 12 years 8 months ago #18518 by flashfred
Bonjour,

Dans une rubrique Actualités, je souhaiterais faire des raccourcis vers des actus de la même catégorie.
J'ai bien sûr pensé au module Flexicontent, mais celui-ci ne sélectionne que les articles de la catégorie en cours.
Hors, dans mon cas, une actualité peut avoir plusieurs catégories, et j'aimerais aller piocher dans toutes celles-là.

J'essaye alors de faire mon propre module. J'ai récupéré les id des catégories de l’article affiché, mais avant de faire une usine à gaz, je me dis qu'il doit y avoir quelque part une fonction toute faite qui me récupère les articles, en lui passant les catégories en paramètres.

Pouvez-vous m'indiquer si cette fonction existe, et où je peux la trouver ?

merci d'avance.
Last edit: 12 years 8 months ago by flashfred.

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

More
12 years 8 months ago #18521 by ggppdk
The v1.5.6 already has 2 new scopes
-- "current item scope" to display fields of the currently displayed item
-- "current language scope" to limit items to those of current language

I put in the TODO to add 2 new scopes

-- Current item's Category Scope
To display items of same category (or categories) of item
-- Current item's Author Scope
to display items of same author of item

Of course these scopes will be combinable with the other scopes too.

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
12 years 8 months ago #18524 by flashfred
Merci pour ta réponse.

En attendant, est-il possible d'avoir le code pour récupérer les articles que je désire ?

J'essaye avec :
Code:
$params->set('catids',$rows); $items = modFlexicontentHelper::getItems($params, $ord);
Mais je n'arrive pas à passer correctement les paramètres( $rows est un tableau avec les Ids des categories).

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

More
12 years 8 months ago #18530 by ggppdk
I am sorry i spoke too fast above

All features are already implemented.
-- There is option for same author IN Author Scope
-- There is option for same category IN Category Scope


Added for all categories of item ...

Get it here:
www.flexicontent.org/forum/index ... pic#p16923


-- 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
12 years 8 months ago #18534 by micker
Tu peus aussi utiliser le module aidanews pour faire ca

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
12 years 8 months ago #18554 by flashfred
Merci pour les réponses.

J'ai téléchargé la nouvelle version du module. L'option "Include : Other categories of item" du Category scope correspond exactement à ce que je recherche.

Malheureusement, ça ne fonctionne pas correctement. Une seule catégorie est prise en compte. En regardant dans la fonction getItems du helper.php, je me suis rendu compte qu'il y avait une erreur dans la requête :
Code:
$q = 'SELECT c.*, ie.type_id, CONCAT_WS(",",ci.catid) as itemcats FROM #__content as c' . ' LEFT JOIN #__flexicontent_items_ext AS ie on ie.item_id = c.id' . ' LEFT JOIN #__flexicontent_cats_item_relations AS ci on ci.itemid = c.id' . ' WHERE c.id = ' . $id;
le CONCAT_WS ne fonctionne pas, et ne renvoie que la première catégorie. Malheureusement, je ne suis pas assez calé en SQL pour pouvoir corriger cette erreur. Une idée ?

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

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