October CMS resources and help articles

Simple and to the point. Optimized by the community.

How to add a canonical link to your layout in twig

2
by mjauvin, last modified on November 14th, 2019

Add this to the section of your layout:

<link rel="canonical" href="{{ url_current() | lower }}" />

or

<link rel="canonical" href="{{ this.page.id | page }}" />

Discussion

1 comment

0
drmzio
Post on November 20th, 2019 6:55 AM

Didn't know about the url_current() function, thanks!

We use cookies to measure the performance of this website. Do you want to accept these cookies?