filter_is_site_url (zotonic_mod_base v1.0.0-rc.17)

Test if the given URL is a url for the current site.

If the current site handles requests for the hostname example.com, then all of the following expressions will echo true:

{{ "https://example.com"|is_site_url }}
{{ "#foo"|is_site_url }}
{{ "/page/path"|is_site_url }}
{{ "//example.com"|is_site_url }}

The following will echo false:

{{ "https://foo.test"|is_site_url }}
{{ "example.com"|is_site_url }}
{{ "//foo.test"|is_site_url }}

See also

sanitize_url, url_abs, url, urlencode

Summary

Functions

is_site_url/2