[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction

Download
Home > English documentation > Webmasters > What are the files in that “dist” directory?

What are the files in that “dist” directory?

April 2004 — updated on : May 2005

All the versions of this article:

Are you wondering what the files in the “dist” directory are? They are the “default” set of template files provided with the SPIP distribution.


As you already know (if you don’t, please read the Reference Manual), the template system is based on .html files that contain the page layout of the site. For instance, article.html displays articles while rubrique.html displays sections, and so on.

If you adapt the .html files provided with SPIP for your own needs, you need to be careful when upgrading the programme. If you are not careful, your own files can be overwritten by the the new ones.

With [SPIP 1.8] the default template files are stored in the “dist” directory, and this helps avoid the problem just mentioned.

If you want to develop your own layout, place template files — article.html, rubrique.html, etc. — at the root of the site, or better still in a directory named squelettes (which SPIP searches automatically). The next time you upgrade SPIP, only the default templates in the dist directory will be overwritten; you will not lose your customised templates.

Note: The .php3 files corresponding to the .html template files still need to be stored at the root of the site.

From version 1.3 up to [SPIP 1.7.2], the template files included with the SPIP distribution were named article-dist.html, rubrique-dist.html, etc. They could be renamed article.html, rubrique.html, etc. (without -dist) and then customised without risk of being overwritten.

Going Further

The .html files of the templates may be named using a section number in order to use a different layout for a particular section and its articles.

This is the order in which SPIP looks for these customised templates:

-  rubrique=10.html: if this file exists then the template is used for section number 10 only;

-  if that file doesn’t exist, SPIP will look for a rubrique-10.html file. If this file exists, section 10 and its sub-sections use it as well;

-  if that file doesn’t exist, SPIP will look for a rubrique.html file applying to all sections of the site that aren’t called by the above files:

If that file doesn’t exist, then versions up to [SPIP 1.7.2] will use the default rubrique-dist.html file. This mechanism was replaced, from [SPIP 1.8] by the use of the dist directory.

-  exactly the same sequence is applied to article templates: article=10.html, article-10.html, article.html (Note: the numbers are section numbers, not article numbers).

Note: The article about custom variables explains how to store all the site templates in one sub-directory for versions previous to [SPIP 1.8].

Show the template of this page Site powered by SPIP | Translation area | Private area