autoload preferences

The $prefer{} directive is a
declaration of autoload preferences, from within a template.
Only one per template is allowed.

When template is fetched on the fly e.g. when evoque’d
from another template, it may either have already been
loaded, compiled, and cached or it may still need to be
looked up and compiled — in this latter case all parameters
that may affect how the template is compiled are needed.
Precisely for such a case, the $prefer{} directive
provides the convenience of specifying default parameter values
that will be used if corresponding values are not specified
when the template is loaded.

Parameters

The parameters are a subset of those of the
evoque directive.
A parameter of the prefer directive is only taken into
consideration if:

  • it has not been explicitly set when the template was first loaded
    i.e. as a parameter of the
    get_template() or $evoque{} call that
    actually loads the template —
    as opposed to subsequent calls that only fetch a template from the cache;
  • the preferred value is different than the cascaded
    default value from the collection.
$prefer{ raw=False, data=None, quoting=”xml”, filters=None }

raw : may trigger template recompile
data : may set value of template.data
quoting : may trigger template recompile
filters : may set value of template.filters

For details of each of these parameters, see the
evoque directive page.