Home + Catégorie Principale + Titre image + Champs image

More
14 years 6 months ago - 14 years 6 months ago #6265 by kim
Bonjour,

Ayant un peu de temps, je profite pour faire partager mes découvertes de Flexi.

Pour une home, si vous voulez avoir des titres en images (oui, c'est plus joli) de vos catégories.
Et si vous voulez récupérer, les champs images de vos catégories.
Ce post vous aidera...

Tout d'abord, il faut récupérer le nom de catégorie principale de votre article (ex: Produits)
Code:
<?php $mycategorie = strip_tags(substr($field->display,0,stripos($field->display,' |'))); ?>

Ensuite, afficher l'image associée à la catégorie (ex: titre_Produits.png).
Code:
<?php echo '<img src="http://www.nomdedomaine.com/images/stories/titre_'.$mycategorie.'.png">'; ?>

Et afficher l'image depuis un champs image (ex: visuel_Produits)
Code:
if (isset($items[$i]->fields['visuel_'.$mycategorie]->value[0])) : $dir{$i} = $items[$i]->fields['visuel_'.$mycategorie]->parameters->get('dir'); $value{$i} = unserialize($items[$i]->fields['visuel_'.$mycategorie]->value[0]); $image{$i} = $value{$i}['originalname']; $scr{$i} = $dir{$i}.'/s_'.$image{$i}; endif;

Un merci à Yopyop qui m'a aidé, soutenu.
Pour voir à quoi peut servir ces quelques lignes de code: www.biblond.com
Last edit: 14 years 6 months ago by kim.

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

More
14 years 6 months ago #6280 by micker
génial super merci pour le partage !
a+

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
14 years 6 months ago #6282 by kim
Y'a pas de soucis de partager.
Mes modifications ne sont pas révolutionnaires, et si ca peut aider ou faire gagner du temps.
En tout cas, je suis prête à répondre à toutes les questions: "comment tu as fait?"

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

More
14 years 3 months ago #8701 by Jay
hi,

could u help to convert into english please.

thnak you.

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

More
14 years 3 months ago #8729 by micker
hello you use google tradution bar with firefox to translate ths page
regards

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
14 years 3 months ago #8740 by Jay

micker wrote: hello you use google tradution bar with firefox to translate ths page
regards

yes i did that
but the language code affected badly.
i could not figure the codes order in fact. the others are ok.

thank you.

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

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