Edit on GitHub
Jump to docs navigation

Twig Components / Methods / absolute_link

absolute_link(link) is a Twig function to create a proper link to either a relative page, or to an external source. In the below example, the editor can provide either page/about, or https://boltcms.io, and both will work:

<a href="{{ absolute_link(block.contentlink|e) }}">Read more</a>

See also Linking in templates, with a detailed description of a good use case.

Source: Bolt



Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.