#INCLURE

#INCLURE is used to add the results of an inclusion into the current template. We call this a "static" inclusion since the results of the compilation are added to the current template, into the same cache file. This tag is therefore different from a "dynamic" inclusion using <INCLURE.../> which creates a separate cache file (with its own specific cache duration).

// preferred format
[(#INCLURE{fond=template_name, argument, argument=xx})]
// other format, best to avoid
[(#INCLURE{fond=template_name}{argument}{argument=xx})]

From the perspective of the visible results, using <INCLURE> or #INCLURE will result in identical contents, but causes quite different operations from the internal management point of view. Dynamic inclusion using <INCLURE> will generate more autonomous cache files. Static inclusion using #INCLURE creates less files, but all of them are larger since their content is duplicated in each page of the cache.

Example

For the current template, add the content resulting from the compilation of the "inc-navigation.html" template, to which we will pass "id_rubrique" as a context argument:

[(#INCLURE{fond=inc-navigation, id_rubrique})]

Note: the inclusions inc-head and inc-navigation in SPIP’s default templates are called using dynamic inclusions, and not static ones as are shown in this example.

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français, Nederlands