AJAX links

In addition to the includes that contain a pagination mechanism, it is possible to specify links to be reloaded using AJAX by adding the CSS class ajax to those links.

  1. <a class="ajax" href="[(#URL_ARTICLE|parametre_url{tous,oui})]">Show all</a>

Example

  1. <INCLURE{fond=modeles/list_articles}{env}{ajax} />

The file modeles/list_articles.html:
Shows or hides the introduction to articles:

  1. <ul>
  2. <BOUCLE_art(ARTICLES){!par date}{0,5}>
  3. <li>#TITRE
  4. [(#ENV{afficher_introduction}|=={oui}|oui)
  5. <div>#INTRODUCTION</div>
  6. ]
  7. </li>
  8. </BOUCLE_art>
  9. </ul>
  10. [(#ENV{afficher_introduction}|=={oui}|oui)
  11. <a class="ajax" href="[(#SELF|parametre_url{afficher_introduction,''})]">Hide the introductions</a>
  12. ]
  13. [(#ENV{afficher_introduction}|=={oui}|non)
  14. <a class="ajax" href="[(#SELF|parametre_url{afficher_introduction,oui})]">Show the introductions</a>
  15. ]

Download

Author Mark Baber Published : Updated : 20/06/10

Translations : English, français