Spip parametrage template




















If necessary you first create the proper loop to fetch the number of the section, and then you place the following code inside this loop:. Note: in this case the hierarchy. To do this you can set the parameter value in this way:. However this is very seldom necessary in practice. Note that this makes it possible to use multilingual strings in included templates see Internationalizing Templates. In other words, included templates here footer.

Since SPIP 2. Note, however, that the duplicates selected in the included template will not "feed back" into the calling template file. SPIP 2. For more details on this functionality, please refer to the detailed article.

This can be a convenient way of separating resource-heavy parts of the site that rarely need regenerating from some dynamic elements requiring frequent updating such as syndication, for example.

In order to tell SPIP to use such varying layouts, you only need to create those varying templates and assign them file names that will indicate to SPIP specifically when to apply them:. Take as an example the article templates for given values of language and section although the explanation below remains equally valid for the templates of sections or news items, and of course, whatever the language and numbers of sections. First of all, remember that SPIP first searches the directory where it retrieves the templates to see if there is a file called article.

Do not create template variants e. If such a variant file exists, SPIP opts to use template files by choosing the one with a file name that is "the most specific", with the section taking precedence over the language code. Listed below in decreasing order of priority are examples of the naming possibilities for the template variant file names:. If section 8 is a sub-section of section 2, and the 2 files above exist, then they would take priority. And, we repeat, it is absolutely necessary that this file also does exist in that same template directory.

Variants of templates by language, by section or by branch.



0コメント

  • 1000 / 1000