#logo et <img alt="texte">

Bonjour,
Je me demande s'il est possible d'ajouter un argument alt="texte" à un logo (#LOGO_ARTICLE) sans passer par une boucle de type :

<B_logo_article>
<BOUCLE__logo_article (ARTICLES) {id_article}>
   #LOGO_ARTICLE
</BOUCLE_logo_article>
</B_logo_article>
mon texte alternatif
<//B_logo_article>

Voici la boucle dans laquelle je souhaite mettre ceci en place :

<B_artnivo1_rubnivo1>
<BOUCLE_artnivo1_rubnivo1 (ARTICLES) {id_rubrique}>

<B_test_expo_artnivo1_rubnivo1>
<BOUCLE_test_expo_artnivo1_rubnivo1 (RUBRIQUES) {id_rubrique}>#EXPOSE{' '}</BOUCLE_test_expo_artnivo1_rubnivo1>
<li>
<div class="nav_article_logo_nivo2">[(#LOGO_ARTICLE|#URL_ARTICLE)]&nbsp;</div>
<div class="nav_article_txt_nivo2"><a href="#URL_ARTICLE" title="#DESCRIPTIF" [class=(#EXPOSE)]>#TITRE</a></div>
</li>
</B_test_expo_artnivo1_rubnivo1>
<//B_test_expo_artnivo1_rubnivo1>
      
</BOUCLE_artnivo1_rubnivo1>
</B_artnivo1_rubnivo1>

[(#LOGO_ARTICLE|#*URL_ARTICLE*||*inserer_attribut*{alt,#_artnivo1_rubnivo1:TEXTE})]

Denis Grugeon a écrit :

Bonjour,
Je me demande s'il est possible d'ajouter un argument alt="texte" à un logo (#LOGO_ARTICLE) sans passer par une boucle de type :

<B_logo_article>
<BOUCLE__logo_article (ARTICLES) {id_article}>
   #LOGO_ARTICLE
</BOUCLE_logo_article>
</B_logo_article>
mon texte alternatif
<//B_logo_article>

Voici la boucle dans laquelle je souhaite mettre ceci en place :

<B_artnivo1_rubnivo1>
<BOUCLE_artnivo1_rubnivo1 (ARTICLES) {id_rubrique}>

<B_test_expo_artnivo1_rubnivo1>
<BOUCLE_test_expo_artnivo1_rubnivo1 (RUBRIQUES) {id_rubrique}>#EXPOSE{' '}</BOUCLE_test_expo_artnivo1_rubnivo1>
<li>
<div class="nav_article_logo_nivo2">[(#LOGO_ARTICLE|#URL_ARTICLE)]&nbsp;</div>
<div class="nav_article_txt_nivo2"><a href="#URL_ARTICLE" title="#DESCRIPTIF" [class=(#EXPOSE)]>#TITRE</a></div>
</li>
</B_test_expo_artnivo1_rubnivo1>
<//B_test_expo_artnivo1_rubnivo1>
      
</BOUCLE_artnivo1_rubnivo1>
</B_artnivo1_rubnivo1>

_______________________________________________
liste spip
spip@rezo.net - désabonnement : spip-off@rezo.net
Infos et archives : http://listes.rezo.net/mailman/listinfo/spip
Documentation de SPIP : http://www.spip.net/
irc://irc.freenode.net/spip
FAQ : FAQ webmestre - SPIP

Denis Grugeon wrote:

Je me demande s'il est possible d'ajouter un argument alt="texte" à un logo (#LOGO_ARTICLE) sans passer par une boucle de type :

la balise #LOGO_ARTICLE retourne un tag html sous la forme :
<img src="IMG/artonxx.jpg" alt="" width="120" height="160" class="spip_logos" />

si tu veux ajouter un contenu à l'attribut alt="" de ce tag, tu peux faire :
[(#LOGO_ARTICLE||inserer_attribut{alt,[(#TITRE|attribut_html)]})]

si tu veux afficher un texte au cas où le logo n'existe pas, et le logo avec le bon alt au cas où il existe, alors :

[ (#LOGO_ARTICLE||?{'',' '}) [(#TITRE|supprimer_numero)] ]
[ (#LOGO_ARTICLE||inserer_attribut{alt,[(#TITRE|attribut_html)]}) ]

si #LOGO_ARTICLE existe, on ne retourne rien : '' ;
donc la partie conditionnelle [(#TITRE|supprimer_numero)] ne s'affichera pas ;
par contre la suite s'affichera

si #LOGO_ARTICLE n'existe pas , on retourne un espace : ' ' ;
donc la partie conditionnelle [(#TITRE|supprimer_numero)] s'affichera ;
par contre la suite n'affichera rien