Les boucles spip et thelia : Différence entre versions

De TheliaDoc
Aller à : navigation, rechercher
(Résumé automatique : blanchiment)
(Annulation des modifications 1763 par Alainormandie (Discuter | Contributions))
 
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 actuelle en date du 8 février 2009 à 13:33

Erreur lors de la création de la miniature : Impossible d'enregistrer la vignette sur la destination
Pour télécharger plugin-thelia

Pour télécharger Thelia Pour télécharger spip

Attention ces boucles nécessitent l'installation du plugin spip-thelia

Plugin Thélia 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.
 #TITRE, #CHAPO
.

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
THELIA-
  • et supprimer le caractère
#
  • la balise #TITRE se rapportant à un titre Thélia doit être renommée
 THELIA-TITRE

#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
rubrique.php?
  • et renomé dans spip et thelia
spip.php?page=rubrique_thelia
  • par la boucle
#URL_PAGE{rubrique_thelia}

dans #URL_PAGE{rubrique_thelia, Un second paramètre est autorisé}

  • Dans thelia
id_rubrique=#RUBRIQUE_ID
  • et renomé dans spip et thelia
id_rubrique=THELIA-RUBRIQUE_ID
#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID}

Exemple #URL_PAGE{rubrique, page_thelia}

  • Dans thelia
page
  • et renomé dans spip et thelia
page_thelia
#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID&page_thelia=}

Exemple #URL_PAGE{rubrique, page_thelia=THELIA-PAGE_PREC}

  • Dans thelia
#PAGE_PREC
  • et renomé dans spip et thelia
THELIA-PAGE_PREC
<a href="#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID&page_thelia=THELIA-PAGE_PREC}"></a>
  • boucle thelia
<a href="rubrique.php?id_rubrique=#RUBRIQUE_ID&page=#PAGE_PREC"></a>
  • boucle renomée pour spip et thelia
<a href="#URL_PAGE{rubrique_thelia,id_rubrique=THELIA-RUBRIQUE_ID&page_thelia=THELIA-PAGE_PREC}"></a>

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:

<form action="#URL_PAGE{panier,lang=#ENV{lang}}" method="post" id="formAjouter">

Merci à shanrez pour cette astuce donnée sur le forum thelia

Liste des boucles spip et thelia (plugin-thelia)

Utilisation avancée du (plugin-thelia)

les liens à consulter pour le (plugin-thelia)

--alainormandie 19 septembre 2008 à 12:15 (CEST)