[Résolu] Label conditionnel

More
8 years 1 month ago - 8 years 1 month ago #60324 by hervemlam
Bonjour,

Je voudrais savoir s'il est possible de faire un Label conditionnel, et comment.

Typiquement, j'ai un champ C1 dont je voudrais que le texte du Label (étiquette) soit modifié selon que le sujet de l'article est masculin ou féminin.

Je pourrais le faire en dur selon les cas, genre : si Article=12 ou Article=15 alors afficher le texte féminin, sinon afficher le texte masculin. Mais à quel endroit faut-il mettre ça ?

Ou alors créer un (autre) champ C2 qui contiendrait le texte à afficher en étiquette de C1... Possible, ça ?
Ou en utilisant des constantes...

Bref, je suis preneur de toutes bonnes idées sur le sujet ! (De préférence, des idées qui auraient déjà été mises en pratique ;) )

Bonne nuit.
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5
Last edit: 8 years 1 month ago by hervemlam.

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

More
8 years 1 month ago #60341 by micker
Replied by micker on topic Label conditionnel
1 si c'est un text field tu as une option de rendu ou tu pourras mettre des boucle php
2 sinon dans ton template tu fais des appel de champs (pas de position, inspire toi du generateur de code dans la partie template de flexi) puis tu mes tes champs concerné dans la partie renderonly

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
8 years 1 month ago #60352 by hervemlam
Replied by hervemlam on topic Label conditionnel
Bonjour,

Merci pour ta réponse.

1. Non, mon champ C1 est un lien hypertexte.
2. Je ne comprends pas comment fonctionne la partie renderonly. J'ai vu que les champs présents dedans n'étaient pas affichés. Peux-tu expliquer et détailler un petit peu plus s'il te plaît ?

Bonne nuit.
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5

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

More
8 years 1 month ago #60353 by micker
Replied by micker on topic Label conditionnel
la position renderonly sert a cacluer un rendu d'un champ qui ne serait pas affiché
flexi ne calcule dans ta vue que les champs étant dans des positions
donc si tu veus utiliser des champs pour calcué des boucles il te faut les placer dans le render only pour apres faire tes appels php

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
8 years 1 month ago #60456 by hervemlam
Replied by hervemlam on topic Label conditionnel
Salut,

Je ne comprends pas bien.
Tu aurais un exemple STP ?

Bonne nuit.
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5

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

More
8 years 1 month ago - 8 years 1 month ago #60458 by micker
Replied by micker on topic Label conditionnel
petit exemple
1 champ texte toto avec comme valeur 1 ou 0
2 tu met toto dans le renderonly (si il n'est pas déjà dans une position

Code:
<?php $valeur1 = $item->fields["toto"]->display; if ( $valeur1 ==1){// si le champs renvoi 1 echo "tu affiche ce tu veus ..."; } ?>
apres georgio te frais un code bien plus puissant mais la ... c'est simple

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]
Last edit: 8 years 1 month ago by micker.
The following user(s) said Thank You: hervemlam

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

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