Automatic link to a page template

Usually, when a page needs a link to another page, you will use a CMS Variable. This is because most pages are created with a "free-content" template and using the Composer to allow the user to reorganize block how he wants.

On some specific cases, you know there will be only 1 page created with the page template and you want a link to it, without having to fill the value of a variable in the backoffice.

For example, you have a booking engine where the user needs to go several page templates:

  • 1 - selecting dates of stay

  • 2 - selecting accommodations

  • 3 - going to the checkout page

  • 4 - going to the confirmation page

To be able to navigate from one page to another, you need to get the URL of the other pages. For this, usually, you would need a CMS variable.

This feature removes this need by giving you the correct link to the page created with this page template

The syntax will be this one #$pagelink|template-key$# and replace template-key with the page template key.

For example, if you have a file page/dates-of-stay.html and you want to get the link to the created with this template, use #$pagelink|dates-of-stay$# and it will be replaced by the link to page the in the current language.

This will search the pages created this page template in the current website, only if this is a page template coming from the current theme (if code added in a theme) or current extension (if code added in an extension).

Last updated