The "connect" URL parameter

When it has not been specified explicitly with a connector file for use within loops, SPIP uses the default connector file (often named connect.php).

For all of these loops, we can request a specific connection that will then be applied by using the URL parameter connect=name.

Example

Say you have 2 SPIP sites with different templates (site A and site B). By copying the connector file for site A over to site B (and renaming it as A.php) and vice versa for site B, you can then navigate the sites in various combinations:

  • http://A/ (the contents of site A appear using template A)
  • http://B/ (the contents of site B appear using template B)
  • http://A/?connect=B (the contents of site B appear using template A)
  • http://B/?connect=A (the contents of site A appear using template B)

In summary, passing connect=name in the URL makes it possible to use the "name" connector file for all the loops in the templates that do not have an explicit connector defined, such as <BOUCLE_a(ARTICLES)>.

Author Mark Baber Published : Updated : 03/07/10

Translations : English, français, Nederlands