wp_list_categories: obtenir la dernière image sélectionnée de la catégorie
2 réponses
- votes
-
- 2011-10-21
Vouspouvez utiliser un Walker personnalisé,dont leplus simple dans votre casest le
La classeWalker_Category
et étendez-le comme ceci:CategoryThumbnail_Walker étend Walker_Category { //Unnouvel élément a ététrébuchéet s'estterminé functionend_el (& amp; $ sortie,$ catégorie,$profondeur,$ args) { //Sortie de lafin du lien standard parent ::end_el (& amp; $ sortie,$ catégorie,$profondeur,$ args); //Obtenez unmessage $posts=get_posts (tableau ( //... de cette catégorie 'catégorie'=> $ category- > cat_ID, 'numberposts'=> 1 )); //Si unmessage a ététrouvé if (isset ($posts [0])) { //Récupère sa vignetteet ajoute-la à la sortie $ vedette=get_the_post_thumbnail ($posts [0] - > ID,'miniature',null); $ sortie.=$en vedette; } } }
Maintenant,votre
wp_list_categories
peut utiliser cemarcheuren fournissant un argument supplémentairemarcheur
comme ceci:wp_list_categories (array ('walker'=>nouveau CategoryThumbnail_Walker ()));
Comme vouspouvez le voir,nous avons deux requêtes supplémentairespour chaque catégorie,unepour obtenir le derniermessageet unepour obtenir sonimageen vedette,alors assurez-vous que cette surchargeestpriseen compte.
Si vous souhaitezpersonnaliser davantage la sortie,vous devrez remplacertoutes lesfonctionnalités de
end_el
oustart_el
pour la classeWalker_Category
.Doublons
Pour vous assurer qu'aucuneimageen doublen'est affichée,vous devezeffectuer les opérations suivantes:
- stocker l'image affichée dans untableau
- vérifier avec chaquenouvelleimage sielleexiste dans letableau
- s'ilexiste - obtenez leprochainmessageet vérifiez sonimage
- s'iln'existepas,ajoutez-le autableauet à la sortie
- comprendre ce que vousfaites,comment celafonctionneraet comment letransformeren codefonctionnel dans votre contexte (en lisant la documentationet en apprenantplus sur PHPet WordPress)
Le code ressemblerait donc à ceci:
La classeCategoryThumbnail_Walker étend Walker_Category { //Unnouvel élément a ététrébuchéet s'estterminé functionend_el (& amp; $ sortie,$ catégorie,$profondeur,$ args) { //Sortie de lafin du lien standard parent ::end_el (& amp; $ sortie,$ catégorie,$profondeur,$ args); //Obtenez unmessage $posts=get_posts (tableau ( //... de cette catégorie 'catégorie'=> $ category- > cat_ID, 'numberposts'=> dix )); //nousenregistrerons lesimages vuesici if (!isset ($this- >images_seen)) $this- >images_seen=array (); foreach ($posts as $post) { //Récupère sa vignetteet ajoute-la à la sortie $ vedette=get_the_post_thumbnail ($post- > ID,'miniature',null); //avons-nous déjà vu cetteimage? if (in_array ($ vedette,$this- >images_seen)) continue; autre { $this- >images_seen []=$en vedette; $ sortie.=$en vedette; Pause; } } } }
You can use a custom Walker, the easiest of which in your case is the
Walker_Category
and extend it like so:class CategoryThumbnail_Walker extends Walker_Category { // A new element has been stumbled upon and has ended function end_el( &$output, $category, $depth, $args ) { // Output the standard link ending parent::end_el( &$output, $category, $depth, $args ); // Get one post $posts = get_posts( array( // ...from this category 'category' => $category->cat_ID, 'numberposts' => 1 ) ); // If a post has been found if ( isset($posts[0]) ) { // Get its thumbnail and append it to the output $featured = get_the_post_thumbnail( $posts[0]->ID, 'thumbnail', null ); $output .= $featured; } } }
Now your
wp_list_categories
can utilize that walker by supplying an additionalwalker
argument like so:wp_list_categories( array('walker' => new CategoryThumbnail_Walker()) );
As you can see we have two additional queries for each category, one to get the latest post, and one to get its featured image, so make sure that this overhead is acknowledged.
If you want to further customize the output you will have to override all of the functionality of
end_el
orstart_el
for theWalker_Category
class.Duplicates
To make sure that no duplicate images are shown you have to do the following things:
- store the displayed image in an array
- check with every new image whether it exists in the array
- if it exists - get next post and check its image
- if it does not exist, add it to array and output
- understand what you're doing, how it will work and how to turn in into working code in your context (by reading the docs and learning more about PHP and WordPress)
So the code would look something like this:
class CategoryThumbnail_Walker extends Walker_Category { // A new element has been stumbled upon and has ended function end_el( &$output, $category, $depth, $args ) { // Output the standard link ending parent::end_el( &$output, $category, $depth, $args ); // Get one post $posts = get_posts( array( // ...from this category 'category' => $category->cat_ID, 'numberposts' => 10 ) ); // we'll record the seen images here if ( !isset($this->images_seen) ) $this->images_seen = array(); foreach ( $posts as $post ) { // Get its thumbnail and append it to the output $featured = get_the_post_thumbnail( $post->ID, 'thumbnail', null ); // have we already seen this image? if ( in_array($featured, $this->images_seen) ) continue; else { $this->images_seen []= $featured; $output .= $featured; break; } } } }
-
Mercipour le code.Cependant,celane produit rien.J'aimis l'extrait de code ci-dessus dansmonfunction.phpet j'ai changé lafonction appelanten ` Php wp_list_categories (array ('walker'=>new CategoryThumbnail_Walker ()));?> `La seule chose qui a changéest qu'il y amaintenant untitreindiquant" Catégories "au-dessus de la liste des catégories.Thank you for the code. It doesn't output anything, though. I put the code snippet above into my function.php and changed the function calling to ` new CategoryThumbnail_Walker()) ); ?>` The only thing that changed is that there's now a headline saying "Categories" above the category list.
- 0
- 2011-10-22
- japanworm
-
Avez-vous des articles dans vos catégories?Le dernier a-t-il uneimageen vedette?Le code ci-dessus a ététestéet fonctionnepourmoi.Voyonspourquoi cen'estpas le caspour vous.Do you have posts in your categories? Does the latest one have a featured image? The code above has been tested and works for me. Let's figure out why it doesn't for you.
- 0
- 2011-10-22
- soulseekah
-
Oui,c'était leproblème (pas depouce) .Merci!Sije voulais styliser unpeu letout,est-ce queje devrais lefaire dans lafonction?Commeparexemplej'aimeraisme débarrasser dutitre "Catégories" qu'il afficheen cemoment,carmaintenantilest double.Deplus,est-ilpossible d'écrire lafonction demanière à ce qu'ellene choisissejamais dutout lamêmeimage?Parexemple.si un article a 3 catégories,alors dans la liste,il affichera lamêmeimage 3fois.Au lieu de cela,ilpourrait obtenir l'image vedette de lapublication avant cettepublication récente afin d'éviter une doubleimage.Ouest-cetrop compliqué?Yes, that was the issue(no thumb).Thanks! If I wanted to style the whole thing a bit, would I have to do that within the function? Like for example I'd like to get rid of the "Categories" title that it's displaying right now, because now it's double. Also, is it possible to write the function so that it will never pick the same image at all? E.g. if one post has 3 categories, then in the list it will display the same image 3 times. Instead it could get the featured image of the post before that recent post in order to avoid a double image. Or is that too complicated?
- 0
- 2011-10-22
- japanworm
-
Actuellement,il ressemble à ceci: http://i53.tinypic.com/20syfqe.jpg [live] (http://www.zoomingjapan.com/blog/)Currently it looks like this: http://i53.tinypic.com/20syfqe.jpg [live] (http://www.zoomingjapan.com/blog/)
- 0
- 2011-10-22
- japanworm
-
Veuillez consulter la documentation [`wp_list_categories ()`] (http://codex.wordpress.org/Template_Tags/wp_list_categories),en particulier.à l'argument `title_li`;lorsque vous avez remplacé votre appel defonctionpar lemien,n'avez-vouspas vu que votre `title_li` était supprimémaintenant?Veuillez lire la documentation.Pourpersonnaliser davantage,vous devrezimplémentertoutes lesfonctionnalités de la classe `Walker_Category` (http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/category-template.php#L773)et étendez la classe `Walker` à laplace,de cettefaçon vouspourrez contrôlerexactement la sortie.Please take a look at the [`wp_list_categories()`](http://codex.wordpress.org/Template_Tags/wp_list_categories) documentation, esp. at the `title_li` argument; when you replaced your function call by mine didn't you see that your `title_li` is removed now? Please read the documentation. To further customize you will have to implement all of the functionality of the `Walker_Category` class (http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/category-template.php#L773) and extend the `Walker` class instead, that way you'll be able to control the output exactly.
- 0
- 2011-10-22
- soulseekah
-
Afin de vous débarrasser des doublons,vous devezgarder unetrace de ce qui a déjà étéextrait desimageset si uneimageest dupliquée,récupérez l'image dumessage suivant (pour cela,assurez-vous que `numberposts`est supérieur à 1,de sorte que letableau deles articles sont suffisamment volumineuxpour sélectionner desimages sélectionnées. Je vais l'ajouter àma réponse.I order to get rid of duplicates you have to keep track of what's images have already been pulled in and if an image is duplicate, fetch the next post image (for that make sure `numberposts` is more than 1, so that the array of posts is large enough to choose featured images from. I'll add this to my answer.
- 0
- 2011-10-22
- soulseekah
-
Mercibeaucoup.Le code des doublonsne fonctionnemalheureusementpas.Désormais,iln'affiche qu'une seule vignettepour la catégorie supérieure (quin'estmêmepas celle du dernier article de cette catégorie),les autres catégoriesn'ont soudainementplus d'image.Deplus,ce quiest assezimportantpourmoi,c'est que la vignetteest également un lien vers la catégorie respective.Comment devrais-jemodifier le codepour yparvenir?J'aijeté un œil à la documentation,mais cela semble assez difficile.Puis-jefusionnermon appel defonctionprécédent avec lemarcheur?Si oui,à quoi cela ressemblerait-il?Thanks so much. The code for the dublicates doesn't work unfortunately. Now, it only displays one thumbnail for the top category (which isn't even the one of the latest post in that category), the other categories suddenly don't get an image anymore. Also, what is quite important to me is that the thumbnail is a link to the respective category as well. How would I have to modify the code in order to achieve that? I had a look at the documentaiton, but this looks quite difficult. Also, can I merge my previous function call with the walker? If so, how would that look?
- 0
- 2011-10-22
- japanworm
-
Le codefonctionnepourmoi,j'aipeut-êtremodifié quelque chose après l'avoir copié.Réessayezet activez leserreurspour êtreplusprécis là où celane fonctionnepas.Afin defournir unmarcheur,vos argumentspour lafonction `wp_list_categories ()` doivent être untableau au lieu d'être une chaîne,alors convertissez-leen tableau.`$ arg ['title_li']='';$ arg ['marcheur']=nouveau ...;$ arg ['showcount']=true; `etc. Juste quelques conseils amicaux,japanworm,38 questions contre 3 réponsesn'estpas unbon karma;Soit vous commencez à lire les documents,répondez aux questions,soit vous constaterezbientôt unmanque de réponses de qualité à vos questions.The code works for me, I may have edited something after you copy-pasta'd it. Try again and switch errors on to be more specific where it does not work. In order to provide a walker your arguments for the `wp_list_categories()` function have to be an array as opposed to being a string, so convert it into an array. `$arg['title_li'] = ''; $arg['walker'] = new ...; $arg['showcount'] = true;` etc. Just some friendly advice, japanworm, 38 questions vs. 3 answers is not good karma; either you start reading the docs, answer questions, or you may soon find lack of quality answers to your questions.
- 0
- 2011-10-22
- soulseekah
-
Aussi,après avoir lu à ce sujetici: http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail,je l'aiessayé,carje veux changer lataille dupouce,mais celane prendpaseffet: `$ vedette=get_the_post_thumbnail ($posts[0] -> ID,tableau (244,65),'miniature',null); `Also, after reading about it here: http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail I tried it, as I want to change the thumb size, but it doesn't take effect: ` $featured = get_the_post_thumbnail( $posts[0]->ID, array(244,65), 'thumbnail', null );`
- 0
- 2011-10-22
- japanworm
-
Activez le rapport d'erreur,l'appel defonctionn'estpas correct.Lafonction accepte 3 arguments,vousen donnez quatre.Turn on error reporting, the function call is not correct. The function accepts 3 arguments, you're giving it four.
- 0
- 2011-10-22
- soulseekah
-
Mercibeaucoup,le code édité abien fonctionné.Je suis reconnaissantpour vos conseils.J'essaye vraiment dur,maisje suis un débutant complet,doncj'aiencore dumal -et jen'aipas l'argentpourembaucher unpigiste.Désolé: (Donc,je suis vraiment,vraiment reconnaissantpour l'aide quej'obtiensicipourformer desgens quien saventbeaucoupplus quemoi actuellement.Thanks so much, the edited code worked well. I'm thankful for your advice. I'm really trying hard, but I'm a complete beginner, so I'm still struggling - and I don't have the money to hire a freelancer. Sorry :( So, I'm really, really thankful for the help I get here form people who know much more than I currently do.
- 0
- 2011-10-22
- japanworm
-
Comment activer le rapport d'erreurs?Désolé,c'est lapremièrefois quej'enentendsparler!How would I turn on error reporting? Sorry, this is the first time I hear of it!
- 0
- 2011-10-22
- japanworm
-
`define ('WP_DEBUG',true);` dans * wp-config.php * + http://www.phpreferencebook.com/tips/display-all-php-errors-and-warnings/`define('WP_DEBUG', true);` in *wp-config.php* + http://www.phpreferencebook.com/tips/display-all-php-errors-and-warnings/
- 0
- 2011-10-22
- soulseekah
-
J'ai résolu leproblème de lataille des vignettes.C'était assezfacile à lafin.Aussi,j'ai lutous vos commentaires unefois deplus.Donc,sij'aibien compris,je suis censéimplémenter letitle_li dans lemarcheur au lieu de l'appel defonction?Mercipour le lien,je vaismettre ça dansmon wp-config.php :)I got the thumbnail size issue to work. Was quite easy in the end. Also, I read through all your comments one more time. So, if I understood correctly I am supposed to implement the title_li into the walker instead of the function call? Thanks for the link, I'm gonna put this into my wp-config.php :)
- 0
- 2011-10-22
- japanworm
-
Non,au lieu d'appeler `wp_list_categories ('show_last_updated=1 & show_count=1 &title_li=');` vousfaites ceci http://pastebin.com/raw.php?i=HeUXA0vN,WordPress accepte les arguments à lafois comme une requêteet comme untableau.No, instead of calling `wp_list_categories('show_last_updated=1&show_count=1&title_li=');` you do this http://pastebin.com/raw.php?i=HeUXA0vN, WordPress accepts arguments both as a query and as an array.
- 0
- 2011-10-22
- soulseekah
-
J'ai déjàessayé quelque chose de similaire,maisj'aieu uneerreur de syntaxe,alorsmercibeaucouppour l'extrait de code carilfonctionnaittrèsbien.J'ai quasimentfini maintenant.J'essaie de comprendre commentfaire de la vignette un lienpour la catégorie,maisje pense déjà avoir vu comment lefaire quelquepart.Je vais l'essayermaintenant :)I already tried something similar, but had a syntax error, so thank you very much for the code snippet as it worked great. I'm pretty much done now. I'm trying to figure out how to make the thumbnail into a link for the category, but I already think I saw how to do it somehwere. Gonna try it out now :)
- 0
- 2011-10-22
- japanworm
-
`$ output.=''. $en vedette. ''``$output .= ''.$featured.''`
- 0
- 2011-10-22
- soulseekah
-
Mercibeaucoup!Jeme sens vraiment stupide: `$ output.=''. $ Vedette. ''; `Je supposeJ'aibesoin de chercher un autremoyen d'obtenir le category_link car celane fonctionnepas (carilgénère http://site Web/php-code).Vraiment,vousm'avezbeaucoup aidé,mercibeaucoup!:)Thanks so much! I really feel stupid: `$output .= ''.$featured.'';` I guess I need to look for another way to get the category_link as this doesnt work (as it outputs http://website/php-code). Really, you helped me so much, thanks a bunch! :)
- 0
- 2011-10-22
- japanworm
-
`$ output.=''. $ vedette. ''; pause; «Avec cela,je sens queje suis déjàtrèsproche.Cependant,celagénère `http://.../category/Array``$output .= ''.$featured.''; break;` With this I feel that I'm already very close. However this is outputting `http://.../category/Array`
- 0
- 2011-10-23
- japanworm
-
Apprenez à utiliser `var_dump ($ variable)`pour voir quelles variables contiennent (enparticulier lestableauxet les objets)et choisissez lesinformations dont vous avezbesoin.`$ category-> cat_name` ou` $ category ['cat_name'] `est ce que vous recherchez.Donc `$ category=get_the_category ()`et c'estparti.Learn how to use `var_dump($variable)` to see what variables contain (esp. Arrays and Objects) and pick the information you need. `$category->cat_name` or `$category['cat_name']` is what you're looking for. So `$category = get_the_category()` and off you go.
- 0
- 2011-10-23
- soulseekah
-
Je vais yjeter un œil,merci.J'espère que celam'aidera à l'avenir àfaire avancer les choses unpeuplus vite :) Jene suispas sûr d'avoirbien compris.Ce quej'aiessayé: `$ category=get_the_category (); $ output.=' '. $en vedette.' '; `qui sort comme" http://../category/",donc lenom de la catégorien'apparaîtpas.I will have a look at it, thanks. Hopefully that will help me in the future to get things done a bit quicker :) I'm not sure if I understood it correctly. What I tried: `$category = get_the_category(); $output .= ''.$featured.'';` which outputs as "http://../category/", so the category name doesn't appear.
- 0
- 2011-10-23
- japanworm
-
Beaucouptrop de commentaires,depersonnes (le système l'a signalé comme unproblème).Si vous avezbesoin debeaucoup de discussions,ilestpréférable de créer une salle de discussion séparéeet de lefaire là-bas.Way too many comments, people (system flagged it as issue). If you need this much discussion it's best to get yourself separate room in chat and do it there.
- 0
- 2011-10-23
- Rarst
-
Est-ilpossible demodifier celapourtravailler avec destaxonomiespersonnalisées?Je suis confus à ce sujet.Is it possible to modify this to work with custom taxonomies? I'm confused about it.
- 0
- 2014-06-17
- JacobTheDev
-
- 2011-10-21
Je sais que vous avez dit que vousne vouliezpas utiliser deplugin,maisje vais quandmême recommander ceci: Images detaxonomie
Vouspouveztoujours le coderen dur dans votrefichier defonctions. Il ajoute unejoliepetite interface aux catégoriespour ajouter uneimage spécifique à chaque catégorie,et fournit desmoyens simples d'obtenir cetteimage sur vospages. Ilfonctionne également sur destaxonomiespersonnalisées sansproblème.
Jementionne lepluginparce que,pour unprojet sur lequelje travaillais,j'essayais votrepremière approche (pour simplementmontrer l'imageen vedette du dernier article dans cette catégorie)mais lorsqu'un articleparticulier était dansplus d'une catégorie,le lamêmeimage a été répétéeplusieursfoiset avait l'airgéniale.
Avoir uneimagepour chaque catégorie agardé un aspect cohérent. Lepluginestfacile à utiliser afin que le clientpuisse changer l'image sansproblème. J'ai également écrit unepetite déclarationif au cas où le client aurait créé unenouvelle catégoriemaisn'apas réussi à ajouter uneimage afin qu'il continue à utiliser la vignette du dernier articlepour cette catégorie (sorte de long,mais vous voyez lepoint) :
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <!--thumbnail --> <? /*asks if the category has an image...else use the post Thumbnail...then if not use the wedding.jpg */ ?> <span class="lighten"><a href="<?= add_query_arg('t', strtolower($term->name), home_url( '/videos/' )); ?>"> <?php $image_link = "<a href=".home_url( '/' ).(strtolower($term->name)).">"; $image = apply_filters( 'taxonomy-images-list-the-terms', '', array( 'taxonomy' => 'video_types', 'image_size' => 'detail', 'after' => '', 'after_image' => '', 'before' => '', 'before_image' => '' ) ); if ( ! empty( $image ) ) {print $image;} elseif ( has_post_thumbnail() ) {the_post_thumbnail(); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/weddings.jpg" alt="<?php echo $term->name;?>" /> <?php } ?></a></span><!--#lighten --> </div><!--#thumb --> <?php endwhile; ?> <?php } } } wp_reset_query(); // Restore global post data stomped by the_post(). ?>
I know you said you wanted to not use a plugin, but I am still going to recommend this: Taxonomy Images
You can always just hardcode it into your functions file. It adds a nice little interface to the categories for adding a specific images to each category, and supplies some easy ways to get that image on your pages. It also works on custom taxonomies with no problem.
I mention the plugin because, for a project I was working on I was trying your first approach (to just show the featured image of the latest post in that category) but when a particular post was in more than one category, the same image was repeated multiple times and looked funky.
Having an image for each category kept a consistent look. The plugin is easy to use so the client could change the image with no probleem. I also wrote a little if statement in case the client created a new category but failed to add an image so that it then went on to use the thumbnail of the latest post for that category (sort of long-winded but you get the point):
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <!--thumbnail --> <? /*asks if the category has an image...else use the post Thumbnail...then if not use the wedding.jpg */ ?> <span class="lighten"><a href="<?= add_query_arg('t', strtolower($term->name), home_url( '/videos/' )); ?>"> <?php $image_link = "<a href=".home_url( '/' ).(strtolower($term->name)).">"; $image = apply_filters( 'taxonomy-images-list-the-terms', '', array( 'taxonomy' => 'video_types', 'image_size' => 'detail', 'after' => '', 'after_image' => '', 'before' => '', 'before_image' => '' ) ); if ( ! empty( $image ) ) {print $image;} elseif ( has_post_thumbnail() ) {the_post_thumbnail(); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/weddings.jpg" alt="<?php echo $term->name;?>" /> <?php } ?></a></span><!--#lighten --> </div><!--#thumb --> <?php endwhile; ?> <?php } } } wp_reset_query(); // Restore global post data stomped by the_post(). ?>
-
Mercibeaucoup.Je suis sûr que d'autrespersonnes apprécient votre réponseet je la conserveraipour référencefuture,maispour l'instant,j'essaye deme passer deplugins aussi souvent quepossible :)Thank you very much. I'm sure other people with appreciate your answer and I'll save it for future reference, but for now I'm trying to go without plugins as often as possible :)
- 0
- 2011-10-22
- japanworm
-
Voici unplugin actuellementmaintenu qui attribue également l'image à la catégorie https://wordpress.org/plugins/wp-custom-taxonomy-image/Here's a currently maintained plugin that also assigns image to category https://wordpress.org/plugins/wp-custom-taxonomy-image/
- 0
- 2018-11-05
- MikeiLL
-
une autre approche consiste à créer un champ de catégorie avec des champspersonnalisés avancéset àinsérer l'image dans unnavigateur de catégoriepersonnalisé comme: https://wordpress.stackexchange.com/a/170603/48604another approach is to create a category field with Advanced Custom Fields and pull in image into a custom category walker like: https://wordpress.stackexchange.com/a/170603/48604
- 0
- 2018-11-06
- MikeiLL
Jepensais à unemeilleurefaçon d'afficher les catégories dansmabarre latérale. Au lieu d'un style de liste simple,j'aimerais que lesimages/vignettes apparaissent également.
J'utilise actuellement les éléments suivants:
Affiche simplement lenom/lien + lenombre d'articles de chaque catégorie. Je veuxgarder cela,mais aussi y ajouter une vignette.
J'aiparcouru cetableaupourtrouver des réponseset j'ai également réfléchi à lafaçon de lefaire,maisje n'aipasencoretrouvé de solution.
Je suppose queje dois créer unefonction qui récupère l'imageen vedette du dernier article de cette catégorie. Si un article comporteplus de catégories,celane devraitpasnonplusposer deproblème.
Créer uneboucle avec un seul article dans cette catégorieet ne sortir que la vignette serait une option,mais la définir demanière à ce que la vignetteet la catégorie correspondentpeut être unproblème. Je suis sûr qu'il doit y avoir unemeilleurefaçon de lefaire.
Jene cherchepas deplugin (carje suis sûr qu'il yen a),je veux le coderen dur.
Si quelqu'un a unebonneidée ou des conseilspour aborder ceproblème,aidez-moi s'il vousplaît.
Mercibeaucoup!