Steffen
Well-known member
- Affected version
- 2.0.10
This isn't a huge deal but these are the only XenForo pages that a crawler regularly reports as "<link rel=canonical> not found". All other XenForo pages already have a rel="canonical" meta tag out of the box.
It would furthermore be awesome if you could add a rel="canonical" meta tag to "poll_results" pages. But this seems to require more than a template change because the following code generates a relative instead of an absolute URL:
Diff:
--- a/src/addons/XF/_data/templates.xml
+++ b/src/addons/XF/_data/templates.xml
@@ -42549,6 +42549,8 @@ span.fr-sr-only {
</dl>]]></template>
<template type="public" title="help_index" version_id="2001070" version_string="2.0.10"><![CDATA[<xf:title>{{ phrase('help') }}</xf:title>
+<xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ link('canonical:help') }}" />
+
<xf:wrap template="help_wrapper" />
<xf:if is="$pages is not empty">
@@ -45586,6 +45588,8 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object
<xf:title>{{ phrase('log_in') }}</xf:title>
+<xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ link('canonical:login') }}" />
+
<xf:if contentcheck="true">
<div class="blockMessage blockMessage--error blockMessage--iconic">
<xf:contentcheck>{$error}</xf:contentcheck>
@@ -45707,6 +45711,8 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object
</xf:form>]]></template>
<template type="public" title="lost_password" version_id="2000033" version_string="2.0.0 Beta 3"><![CDATA[<xf:title>{{ phrase('lost_password') }}</xf:title>
+<xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ link('canonical:lost-password') }}" />
+
<xf:form action="{{ link('lost-password') }}" class="block" ajax="true">
<div class="block-container">
<div class="block-body">
@@ -53330,6 +53336,8 @@ button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-bloc
<xf:title>{{ phrase('register') }}</xf:title>
+<xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ link('canonical:register') }}" />
+
<xf:if is="$providers is not empty">
<div class="block">
<div class="block-container">
It would furthermore be awesome if you could add a rel="canonical" meta tag to "poll_results" pages. But this seems to require more than a template change because the following code generates a relative instead of an absolute URL:
HTML:
<xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ $poll.getLink('results') }}" />