Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > Accessing a declared database

Accessing a declared database

Every additionally declared database can be accessed using SPIP loops as follows:

  1. <BOUCLE_externe(name:TABLE)>

The name parameter corresponds to the name of the connector file.

Example

In testing with WordPress some time ago, the author was able to establish a functional database link.
By creating a wordpress.php connector file, it was possible to recover the last 5 published articles with the code shown below:

  1. <BOUCLE_articles(wordpress:WP_POSTS){0,5}{!par post_date}{post_status=publish}>
  2. <h2>#POST_TITLE</h2>
  3. <div class="texte">#POST_CONTENT</div>
  4. </BOUCLE_articles>

Download