Linking Pages

An AMP page's head element should always include a link to the default version of the same page, if one exists:

<link rel="canonical" href="default-version-url">

The Widget Framework automatically includes such links in pages rendered using the amp content profile.

Similarly, the default page's head element should always include a link to the AMP version of the same page, if one exists:

<link rel="amphtml" href="amp-version-url">

The Widget Framework does not, however automatically include such links in pages rendered using the default content profile. You must set the following section parameter to include it.

amp.enabled=true

The code that generates these links can be found in your publication webapp's /template/framework/amp/head/canonical.jsp file. By default it produces links that match the default URLs of AMP pages rendered by the Widget Framework (that is, the same as the default page URL plus the suffix /amp).

Your system may, however, be configured in such a way your AMP pages don't have the default URLs provided by the Widget Framework – your AMP pages might, for example, be served from a different domain name and/or have a different suffix.

If your AMP page URLs do not have the default format, then modify the generated links by editing the /template/framework/amp/head/canonical.jsp template in your webapp. By default, this contains the following code, which produces the default AMP URLs.

<%@ page session="false" %>
<@ taglib prefix="wfn" uri="http://www.escenic.com/widget-framework/functions" %>
<link rel="amphtml" href="${wfn:resolveAMPLink(param.pageURL, "amp")}">

All you need to do is replace "amp" with the correct suffix.