|url_absolue

  • New in : SPIP 1.8.2

-  |url_absolue works in the same way as the |liens_absolus filter, but is applied to a tag that returns a URL (e.g. #URL_ARTICLE or #URL_RUBRIQUE...).

Examples:
<a href="-Publications-"...
will be transformed into
<a href="http://le_site.fr/-Publications-"...

or
<a href="spip.php?rubrique67"...
will transform into
<a href="http://le_site.fr/spip.php?rubrique67"...

In the same fashion, |url_absolue can be applied to the #CHEMIN tag:

[(#CHEMIN{polices/dustismo_bold.ttf}|url_absolue)]

will return http://mon_domaine.tld/squelettes-dist/polices/dustismo_bold.ttf .

Forcing a base URL

Warning, this tag retains the protocol (http or https) and the host name of the calling page. To force a particular base URL, it is possible to pass one as an argument. This can prove to be useful if your site is broken down into several sub-domains, but you would still like to force a certain prefix.

For example, if your site is comprised of a.the-site.fr, b.the-site.fr, etc.:

#CHEMIN{truc.css}|url_absolue{#URL_SITE_SPIP}

will return:
http://the-site.fr/squelettes/truc.css
and will return the same value even if the tag is called from within a.the-site.fr.

See also

Filters |abs_url et liens_absolus

Author Mark Published : Updated : 05/10/22

Translations : català, English, Español, français, Nederlands