[résolu] Requete pour les nouveaux champ d'un article

More
9 years 7 months ago - 9 years 7 months ago #49403 by pgagnebin
Bonjour
Pour obtenir tous les champs d'un article, la requete SQL "$query = 'SELECT * FROM #__content'" nickel.
Comment puis-je faire pour obtenir les champs ajoutés à un article grace a FlexiCOntent. Par exemple, j'ai ajoute un champ "lieu_vacances" comme "select_list" dans un article, et j'aimerais l'utiliser dans mon site.
Merci
Pascal
Last edit: 9 years 7 months ago by pgagnebin.

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

More
9 years 7 months ago #49405 by ggppdk
Hello

i don't understand your question

are you a developer ?

and you want to display FLEXIcontent field data inside 3rd party code ?

Retrieving the HTML DISPLAY of FC fields inside 3rd-party code

after executing getFieldDisplay,
then to also use this to have the raw field values of fields:
Using the raw value of a field inside a template file or inside a new custom field type


-- 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 7 months ago #49484 by pgagnebin
Hi
I found solution with the given topics
Pascal

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

More
9 years 7 months ago #49487 by micker
penses a poster ta solution et a ajouté [résolu] dans le titre de ton premier post
Merci

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
9 years 7 months ago #49493 by pgagnebin
Note : la solution n'est pas terminée...
L'objectif est de construire dynamiquement une liste de liens en se basant sur la rubrique à laquelle sont assignés les articles.
Code:
public static function getList(&$params) { // récupère la connexion à la BD $db = JFactory::getDbo(); // Construit la requête // $query = 'SELECT id, title FROM #__content'; $query = 'SELECT * FROM #__content'; // Exécute la requête $db->setQuery($query); $items = $db->loadObjectList(); // Pour conserver la liste des items $item_array = array(); $array_rubriques = array(); $last_item = null; $i = 0; foreach ($items as $item) { $last_item = $item; $item_array[$i++] = $item->id; $item->link = JRoute::_('index.php?option=com_content&view=article&id=' . $item->id); } // Il faut aller chercher le champs vp_rubrique (FLEXI) $itemmodel_name = FLEXI_J16GE ? 'FlexicontentModelItem' : 'FlexicontentModelItems'; $itemmodel = new $itemmodel_name(); foreach ($item_array as $item_id) { $item = $itemmodel->getItem($item_id, $check_view_access = false); $item_link = JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug)); // Get fields values from the DB FlexicontentFields::getFieldDisplay($item, 'vp_rubrique'); $vp_rubrique_label = $item->fields['vp_rubrique']->label; $vp_rubrique = $item->fields['vp_rubrique']->display; $display = $item->fields['vp_rubrique']->display; $rubrique = $display ? $display : "empty"; if (array_key_exists($rubrique, $array_rubriques)) $array_rubriques[$rubrique] = $array_rubriques[$rubrique]+1; else $array_rubriques[$rubrique] = 1; } // dump($last_item, "Helper : liste des articles"); // dump($item_array, "Helper : liste des id"); dump($array_rubriques, "Liste des rubriques"); return $items; }

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

More
9 years 7 months ago #49494 by micker
que je recap tu affiche une liste d'article de la même categorie que l'item courant ?
si oui le module universel peut le faire sans hack ;)

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