Les boucles spip et thelia : Différence entre versions

De TheliaDoc
Aller à : navigation, rechercher
(Exemple #URL_PAGE{rubrique, page_thelia=THELIA-PAGE_PREC})
(Résumé automatique : blanchiment)
Ligne 1 : Ligne 1 :
[[Image:Logo_spip_thelia.png]][http://files.spip.org/spip-zone Pour télécharger plugin-thelia]
 
[http://thelia.fr/informations__1_telecharger_8.html Pour télécharger Thelia]
 
[http://www.spip.net/fr_download Pour télécharger spip]
 
  
'''Attention ces boucles nécessitent l'installation du plugin spip-thelia'''
 
 
Plugin Thélia [http://www.spip-contrib.net/Plugin-Thelia le site du développement]
 
 
=='''Modification légère de la syntaxe de Thélia (plugin-thelia)'''==
 
 
* Certaines '''balises Thélia''' sont identiques aux''' balises SPIP'''.
 
<pre> #TITRE, #CHAPO</pre>.
 
'''Pour éviter une confusion entre les deux moteurs'''
 
* il sera nécessaire de modifier légèrement la syntaxe des '''balises Thélia'''.
 
'''La modification à faire est la suivante :'''
 
* '''préfixer les balises du mot'''
 
<pre>THELIA-</pre>
 
* '''et supprimer le caractère'''
 
<pre>#</pre>
 
* '''la balise '''#TITRE''' se rapportant à un '''titre Thélia''' doit être renommée'''
 
<pre> THELIA-TITRE</pre>
 
 
==='''#URL_PAGE{page}'''===
 
 
'''#URL_PAGE''' retourne une url de type « '''page''' »
 
* vers la page passée en paramètre et qui pourra être utilisée dans un lien.
 
* Par exemple, pour accéder à la page générée par le squelette '''page.html''',
 
* située dans votre répertoire plugins/plugin-thelia
 
* '''#URL_PAGE{page}''' généra automatiquement l’url '''spip.php?page=page'''.
 
*'''Un second paramètre est autorisé''' pour ajouter des paramètres à l’url.'''Exemple'''
 
* '''#URL_PAGE{page,lang=#LANG}''' génèrera '''l’url spip.php?page=page&lang=xxx'''.
 
 
==='''Exemple #URL_PAGE{rubrique}'''===
 
 
* '''Dans thelia'''
 
<pre>rubrique.php?</pre>
 
* '''et renomé dans spip et thelia'''
 
<pre>spip.php?page=rubrique_thelia</pre>
 
* '''par la boucle'''
 
<pre>#URL_PAGE{rubrique_thelia}</pre>
 
 
==='''dans #URL_PAGE{rubrique_thelia, '''Un second paramètre est autorisé'''}'''===
 
* '''Dans thelia'''
 
<pre>id_rubrique=#RUBRIQUE_ID</pre>
 
* '''et renomé dans spip et thelia'''
 
<pre>id_rubrique=THELIA-RUBRIQUE_ID</pre>
 
<pre>#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID}</pre>
 
 
==='''Exemple #URL_PAGE{rubrique, page_thelia}'''===
 
* '''Dans thelia'''
 
<pre>page</pre>
 
* '''et renomé dans spip et thelia'''
 
<pre>page_thelia</pre>
 
<pre>#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID&page_thelia=}</pre>
 
 
==='''Exemple #URL_PAGE{rubrique, page_thelia=THELIA-PAGE_PREC}'''===
 
* '''Dans thelia'''
 
<pre>#PAGE_PREC</pre>
 
* '''et renomé dans spip et thelia'''
 
<pre>THELIA-PAGE_PREC</pre>
 
<pre><a href="#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID&page_thelia=THELIA-PAGE_PREC}"></a></pre>
 
* '''boucle thelia'''
 
<pre><a href="rubrique.php?id_rubrique=#RUBRIQUE_ID&page=#PAGE_PREC"></a></pre>
 
*''' boucle renomée pour spip et thelia'''
 
<pre><a href="#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID&page_thelia=THELIA-PAGE_PREC}"></a></pre>
 
 
==='''La variable #LANG'''===
 
 
La variable #LANG ne renvoie la langue passée en URL qu'en dehors d'une boucle SPIP.
 
 
A l'intérieur d'une boucle spip, c'est la langue de l'article (ou de la rubrique, enfin, ce sur quoi on boucle) qui est retournée...
 
 
Par contre, SPIP à introduit depuis la version 1.8 une nouvelle variable #ENV qui permet de retourner une variable d'environnnement à l'intérieur d'une boucle spip.
 
 
Il faut  modifié la boucle THELIA pour utiliser #ENV{lang} plutôt que #LANG et cela fonctionne parfaitement...
 
 
donc le form action devient:
 
 
<pre>
 
<form action="#URL_PAGE{panier,lang=#ENV{lang}}" method="post" id="formAjouter">
 
</pre>
 
 
Merci à shanrez pour cette astuce donnée sur le forum thelia
 
 
=='''Liste des boucles spip et thelia (plugin-thelia)'''==
 
 
* [[La boucle ACCESSOIRE spip et thelia]]
 
* [[La boucle ADRESSE spip et thelia]]
 
* [[La boucle CARACDISP spip et thelia]]
 
* [[La boucle CARACTERISTIQUE spip et thelia]]
 
* [[La boucle CARACVAL spip et thelia]]
 
* [[La boucle CHEMIN spip et thelia]]
 
* [[La boucle CLIENT spip et thelia]]
 
* [[La boucle COMMANDE spip et thelia]]
 
* [[La boucle CONTENU spip et thelia]]
 
* [[La boucle DECLIDISP spip et thelia]]
 
* [[La boucle DECLINAISON spip et thelia]]
 
* [[La boucle DECVAL spip et thelia]]
 
* [[La boucle DEVISE spip et thelia]]
 
* [[La boucle DOCUMENT spip et thelia]]
 
* [[La boucle DOSSIER spip et thelia]]
 
* [[La boucle IMAGE spip et thelia]]
 
* [[La boucle PAGE spip et thelia]]
 
* [[La boucle PAIEMENT spip et thelia]]
 
* [[La boucle PANIER spip et thelia]]
 
* [[La boucle PAYS spip et thelia]]
 
* [[La boucle PRODUIT spip et thelia]]
 
* [[La boucle QUANTITE spip et thelia]]
 
* [[La boucle RUBRIQUE spip et thelia]]
 
* [[La boucle RSS spip et thelia]]
 
* [[La boucle STOCK spip et thelia]]
 
* [[La boucle TRANSPORT spip et thelia]]
 
* [[La boucle VENTEPROD spip et thelia]]
 
* [[Les boucles conditionnelles spip et thelia]]
 
* [[Substitutions parrain spip et thelia]]
 
* [[Substitutions message spip et thelia]]
 
* [[Les filtres spip et thelia]]
 
* [[Les formulaires spip et thelia]]
 
 
=='''Utilisation avancée du (plugin-thelia)'''==
 
 
* [[PRODUITS_ARTICLES|'''PRODUITS_ARTICLES''' boucle produits Thélia associés aux articles SPIP]]
 
* [[RUBRIQUESTHELIA_ARTICLES|'''RUBRIQUESTHELIA_ARTICLES''' boucle rubriques Thélia associées aux articles SPIP]]
 
* [[PRODUITS_RUBRIQUES|'''PRODUITS_RUBRIQUES''' boucle produits Thélia associés à des rubriques SPIP]]
 
* [[RUBRIQUESTHELIA_RUBRIQUES|'''RUBRIQUESTHELIA_RUBRIQUES''' boucle rubriques Thélia associées à des rubriques SPIP]]
 
 
=='''les liens à consulter pour le (plugin-thelia)'''==
 
 
* [[Installation thelia et le plugin spip-thelia]]
 
* [[Installation en local avec WampServer]]
 
* [[Installation en local avec EasyPhp]]
 
* [[la réécriture d'URL l’utilisation conjointe des deux logiciels SPIP et Thélia]]
 
 
--[[Utilisateur:Alainormandie|alainormandie]] 19 septembre 2008 à 12:15 (CEST)
 

Version du 25 novembre 2008 à 20:59