Automatic joins

Whenever a loop is requested to use a criteria which does not belong to the loop’s own primary table, SPIP automatically tries to find a linked table which contains the requested field.

SPIP has two methods to find linked tables: either through links that are declared explicitly, or ones that are calculated.

Example

Retrieve the documents which are inserted into the body text of articles or other editorial content (as with a <docXX> type model), and which are not just linked to that object. The vu field belongs to the spip_documents_liens table, so a join is created to that table to obtain the desired result.

  1. <BOUCLE_doc(DOCUMENTS){0,10}{vu=oui}>
  2. - #FICHIER<br />
  3. </BOUCLE_doc>

Download

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

Translations : English, français