The SITES loop (or Syndication)

The SITES loop returns a list of referenced sites.

<BOUCLEn(SITES){criteria... }>

If referenced sites are syndicated, this loop is also associated with a SYNDIC_ARTICLES loop which makes it possible to retrieve a list of articles from these sites.

Selection Criteria

You should use one of the following criteria to indicate which sites are selected.

-  {tout} returns all referenced sites.

-  {id_syndic} returns the referenced site identified by id_syndic.

-  {id_rubrique} returns the sites referenced in this section.

-  {id_secteur} returns the sites referenced in this sector.

-  {id_mot} returns the sites related to the current keyword (inside a MOTS loop, or a URL parameter).

-  {titre_mot=xxxx} , or {type_mot=yyyy} returns the sites related to the keyword named "xxxx", or related to keywords in the keyword group named "yyyy". If you provide several {titre_mot=xxxx} criteria (or several {type_mot=yyyy} criteria), you will select those that have ALL of those keywords at the same time.

-  {id_groupe=zzzz} allows you to select the sites related to a keyword group; effectively the same as {type_mot} above, but since an identifier (number of the group), the syntax of the internal code will be cleaner.

Display Criteria

You can use any of the criteria applicable to all loops.

-  {syndication=oui}, or {syndication=non} are used to display only the referenced sites that are subject to syndication, or which are only referenced without being syndicated. A possible off value indicates that a syndication error has been detected.

-  {moderation=oui} displays the syndicated sites whose links are initially blocked pending moderation; the reverse of this criterion is {moderation!=oui}.

Tags of this loop

-  Tags retrieved from the database

The following tags correspond to the elements retrieved directly from the database. You can also use them as sorting criteria (in general: {par nom_site}).

-  #ID_SYNDIC is the unique identifier of the syndicated site. For example, to return the page describing the site (site.html in /dist) with the following code:

<BOUCLE_sites(SITES) {id_rubrique} {par nom_site}>
<li><a href="[(#ID_SYNDIC|generer_url_site)]">#NOM_SITE</a></li>
</BOUCLE_sites>

-  #NOM_SITE displays the name of the syndicated site.

-  #URL_SITE displays the (URL) address of the syndicated site.

-  #DESCRIPTIF displays the description of the syndicated site.

-  #ID_RUBRIQUE displays the section number containing this syndication.

-  #ID_SECTEUR displays the sector number (section at the root of the site) containing this syndication.

-  Other tags

-  #LOGO_SITE returns the logo assigned to the site.

-  #URL_SYNDIC returns the (URL) address of the syndication file of this site.

-  #FORMULAIRE_FORUM generates and displays the form used for posting forum messages about this site. For more information on this, see also "Forms".

-  #PARAMETRES_FORUM generates the list of variables used by the form interface used for posting forum messages about this site. For instance:

[<a href="spip.php?page=forum&(#PARAMETRES_FORUM)">Respond to this forum</a>]

It can be passed a parameter specifying the return address after posting the message.
For example:

<a href="spip.php?page=forum&(#PARAMETRES_FORUM{#SELF})">Respond to this message</a> 

will redirect the visitor tback to the current page once the message has been validated.

Author Paolo, Paul Knight Published : Updated : 05/04/23

Translations : عربي, català, Deutsch, English, Español, français, italiano, Nederlands