1 message de forum 'inc-photos x 2 ou 3... dans Escal V3 et SPIP 3.1.3'

C’est bon, je l’ai ! C’est parti : tu crées un fichier
mes-photos.html dans /squelettes/modeles (...) |

**Escal V3**

Message posté par Jean Christophe Villeneuve
<jean-chris.villeneuve@ac-lyon.fr> à la suite de l’article
« inc-photos ».
* * *

## inc-photos x 2 ou 3... dans Escal V3 et SPIP 3.1.3

C’est bon, je l’ai ! C’est parti :

* tu crées un fichier mes-photos.html dans /squelettes/modeles (dossier
et sous-dossier à créer si pas existant) aves ce code :

`<script><br />
// Il faut instancier un objet Rotative pour assurer la rotation des
photos<br />
$(document).ready(<br />
  function()<br />
  {<br />
    new Rotative<br />
    (<br />
      {<br />
        container : "#mes-photos-defilantes",<br />
        element : "div.une-photo",<br />
        tempo : [(#CONFIG{escal/config/tempophotos, 8})]<br />
      }<br />
    )<br />
  }<br />
) ;<br />
</script><br />
<br />
<br />
<!-- on selectionne les articles avec le mot-cle mes-photos et on stocke
dans doublons photos2 --><br />
    <BOUCLE_selection_articles2(ARTICLES){titre_mot=mes-photos}{par
hasard}{0,10}><br />
     
<BOUCLE_selection_docs2(DOCUMENTS){id_article}{mode=image}{extension==jpg|png|gif}{0,10}{par
hasard}{doublons photos2}><br />
      </BOUCLE_selection_docs2><br />
    </BOUCLE_selection_articles2><br />
<br />
<br />
#SET{nombrephotos,#CONFIG{escal/config/nombrephotos,5}}<br />
  <div id="mes-photos-defilantes"><br />
<br />
      <BOUCLE_photo_une(DOCUMENTS){!doublons photos2}{par
hasard}{0,#GET{nombrephotos}}><br />
      <div class="une-photo"> <br />
     <br />
<BOUCLE_titre_article(ARTICLES){id_document}{0,1}> <br />
#SET{lien,#URL_ARTICLE}<br />
</BOUCLE_titre_article> <br />
      <br />
      [(#CONFIG{escal/config/lienphotos}|=={non}|non) <br />
      <LIEN href="[(#GET{lien}|parametre_url{lang,#ENV{lang}})]"> <br
/>
      ]<br />
      <img
src="[(#FICHIER|image_reduire{[(#CONFIG{escal/config/largeurimagenoisettes,170})]}|extraire_attribut{src})]"<br
/>
                                 alt='[(#TITRE)]'<br />
                                 title="[(#TITRE)]" /><br />
      [(#CONFIG{escal/config/lienphotos}|=={non}|non)<br />
      </LIEN><br />
      ]<br />
      <br />
      </div><br />
      </BOUCLE_photo_une><br />
<br />
        </div> `

en remplaçant les 2 occurrences de "LIEN" par "a" (obligé de faire ça,
sinon mon code ne passe pas, anti-spam oblige)

* tu rajoutes le code suivant à ton fichier perso.css (ou tu crées ce
fichier dans un dossier /squelettes/styles)
    `/* noisette mes-photos */<br />
/***********************/<br />
#mes-photos-defilantes {<br />
  position: relative;<br />
  overflow: hidden;<br />
  margin: auto;<br />
  height: 170px;<br />
}<br />
.une-photo {<br />
  position: absolute;<br />
  width: 100%;<br />
  margin: auto;<br />
  text-align: center;<br />
  top: 340px ;<br />
}`

<!-- -->

* tu crées un mot-clé "mes-photos" dans le groupe "affichage" par
exemple

<!-- -->

* tu attribues ce mot-clé "mes-photos" à tous les articles dont tu veux
récupérer les photos

<!-- -->

* tu crées un article dont le titre sera celui de la noisette affichée
et tu mets dans le texte de cet article
    `<mes-photos|>`

<!-- -->

* tu attribues à cet article le mot-clé "article-libre1" (ou un autre
numéro si déjà utilisé)

<!-- -->

* tu vas dans la config d’Escal et tu affiche la noisette "Article
libre 1" où tu veux

<!-- -->

* tu admires le résultat ... ou tu me dis ce qui cloche !

* * *

### Modération

Ne répondez pas à ce mail mais sur le forum à l’adresse suivante :
http://www2.ac-lyon.fr/services/escal/spip.php?article144#forum6230

— Envoyé par Escal V3 (http://www2.ac-lyon.fr/services/escal/#/)