<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic what’s the best practice for pushing a rel canonical into the header from a module on a certain set in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/980585#M39192</link>
    <description>&lt;P&gt;I see that I can disable auto canonicals, and write my logic in the base template, but I suspect there's cleaner way, and woudl love to do that.&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2024 15:56:17 GMT</pubDate>
    <dc:creator>tony5280</dc:creator>
    <dc:date>2024-05-22T15:56:17Z</dc:date>
    <item>
      <title>what’s the best practice for pushing a rel canonical into the header from a module on a certain set</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/980585#M39192</link>
      <description>&lt;P&gt;I see that I can disable auto canonicals, and write my logic in the base template, but I suspect there's cleaner way, and woudl love to do that.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 15:56:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/980585#M39192</guid>
      <dc:creator>tony5280</dc:creator>
      <dc:date>2024-05-22T15:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certa...</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981263#M39218</link>
      <description>&lt;P&gt;Hi, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/765943"&gt;@tony5280&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for your question! I'd like to invite some community members to the conversation. Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53048"&gt;@evaldas&lt;/a&gt;&lt;/SPAN&gt; &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/721491"&gt;@DanielPicklo&lt;/a&gt;&lt;/SPAN&gt;, do you have any suggestions for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/765943"&gt;@tony5280&lt;/a&gt;&lt;/SPAN&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 14:50:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981263#M39218</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-05-23T14:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981372#M39223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/765943"&gt;@tony5280&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you elaborate on your use case / what you are trying to achieve?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you looking to place the rel="canonical" into the the &amp;lt;head&amp;gt; through a module instead of a template?&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 18:06:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981372#M39223</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2024-05-23T18:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981383#M39226</link>
      <description>&lt;P&gt;counseling site.&amp;nbsp;&lt;BR /&gt;I have two sets of dynamic pages hanging off the one counselors table.&lt;BR /&gt;dyanmic counselor pages are /counselors/entity-hs_path&lt;BR /&gt;&lt;BR /&gt;Counselors have intake forms that are specific to the counselor.&lt;BR /&gt;for ease of admin use, I want that path to be /intake/entity-hs_path&lt;BR /&gt;Spiders can hit /intake/ but I don't want spiders crawling the dir.&amp;nbsp;&lt;BR /&gt;The canonical should be /counselors/&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 18:35:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981383#M39226</guid>
      <dc:creator>tony5280</dc:creator>
      <dc:date>2024-05-23T18:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981457#M39233</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% if dynamic_page_crm_object %}
  
  {% set canonicalUrl = request.path|replace("intake", "counselors") %}

  {% require_head %}
      &amp;lt;meta name="robots" content="noindex"&amp;gt;
      &amp;lt;link rel="canonical" href="{{ canonicalUrl }}" /&amp;gt;
  {% end_require_head %}

{% endif %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;dynamic_page_crm_object conditional will apply this to dynamic pages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The require_head will place items in the&amp;nbsp;standard_header_include.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 21:16:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981457#M39233</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2024-05-23T21:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981507#M39236</link>
      <description>&lt;P&gt;Thank you. that's very close to what I'm doing, and I realize I wasn't clear.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if request.path is containing "/intake/" %}
	{% set canon = request.scheme ~ "://" ~ request.domain ~ request.path | replace("/intake/","/counselors/") %}
	{% require_head %}
		&amp;lt;meta name="robots" content="noindex,nofollow"&amp;gt;
		&amp;lt;link rel="canonical" href="{{ canon }}" /&amp;gt;
	{% end_require_head %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I'm hoping to find a way to leave auto-canonicals on, then at some point in the code, whether the template or a module, supercede/clobber/override the existing canonical. I don't want to end up with two canonicals in the header (as this does), or, ideally, have to declare canonicals on each page.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 00:02:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981507#M39236</guid>
      <dc:creator>tony5280</dc:creator>
      <dc:date>2024-05-24T00:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981983#M39249</link>
      <description>&lt;P&gt;I could not find anything that would allow adding conditions in HubL for the auto-canonicals.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you could potentially disable the auto-canonical in the settings and mimic that with code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% if request.path is containing "/intake/" %}
  {% set canon = request.scheme ~ "://" ~ request.domain ~ request.path | replace("/intake/", "/counselors/") %}
  {% require_head %}
    &amp;lt;meta name="robots" content="noindex,nofollow"&amp;gt;
    &amp;lt;link rel="canonical" href="{{ canon }}" /&amp;gt;
  {% end_require_head %}
{% else %}
  {% require_head %}
    &amp;lt;link rel="canonical" href="{{ request.scheme }}://{{ request.domain }}{{ request.path }}" /&amp;gt;
  {% end_require_head %}
{% endif %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously this snippet would need to be inlcuded on every single page of the site (via template or partial).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only thing to watch out here is that this would not accommodate any canonical overrides that happen on individual page settings.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 19:51:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981983#M39249</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2024-05-24T19:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981991#M39250</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53048"&gt;@evaldas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I could not find anything that would allow adding conditions in HubL for the auto-canonicals.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you could potentially disable the auto-canonical in the settings and mimic that with code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if request.path is containing "/intake/" %}
  {% set canon = request.scheme ~ "://" ~ request.domain ~ request.path | replace("/intake/", "/counselors/") %}
  {% require_head %}
    &amp;lt;meta name="robots" content="noindex,nofollow"&amp;gt;
    &amp;lt;link rel="canonical" href="{{ canon }}" /&amp;gt;
  {% end_require_head %}
{% else %}
  {% require_head %}
    &amp;lt;link rel="canonical" href="{{ request.scheme }}://{{ request.domain }}{{ request.path }}" /&amp;gt;
  {% end_require_head %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously this snippet would need to be inlcuded on every single page of the site (via template or partial).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing to watch out here is that this would not accommodate any canonical overrides that happen on individual page settings.&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;Precisely my reason for seeking best practices here.&lt;BR /&gt;&lt;BR /&gt;A method to inject into the head should be more id10t-proof. I'm trying to think of a good reason to push duplicate or conflicting values into the head, and can't think of any.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 20:01:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/981991#M39250</guid>
      <dc:creator>tony5280</dc:creator>
      <dc:date>2024-05-24T20:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/982022#M39256</link>
      <description>&lt;P&gt;Got it. If there was a way to check whether a custom canonical is present in the page settings, this method would actually prevent duplicate and conflicting values (assuming the auto-canonical is disabled in the settings).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is only one variable I could find {{&amp;nbsp;page_meta.canonical_url }} but even that returns the actual page URL instead of the custom canonical, which is odd and not helpful in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the canonicals are part of the standard_header_includes, not sure that there are any other options, besides doing some javascript manipulation which also isn't great.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I couldn't help you here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 20:43:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/982022#M39256</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2024-05-24T20:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/989904#M39436</link>
      <description>&lt;P&gt;Turns out that's not the only thing to watch out for.&lt;BR /&gt;&lt;BR /&gt;First, even with auto-canonicals off, hubspot pushes into _hsq what they assumed to be the canonical:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;_hsq.push(["setCanonicalUrl", "https:\/\/site.com\/assumption"]);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I've yet to understand the ramifications of that.&lt;BR /&gt;&lt;BR /&gt;Second, if your pages are generated by a hubdb table, hubspot will inject another canonical. Doesn't appear that can be turned off anywhere.&lt;BR /&gt;&lt;BR /&gt;This **bleep**!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 18:32:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/989904#M39436</guid>
      <dc:creator>tony5280</dc:creator>
      <dc:date>2024-06-10T18:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: what’s the best practice for pushing a rel canonical into the header from a module on a certain</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/989907#M39437</link>
      <description>&lt;P&gt;It's funny, the&amp;nbsp;&lt;SPAN&gt;page_meta.canonical_url is documented as&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;The official URL that this page should be accessed at. Usually does not include any query string parameters. Use this for the rel="canonical" tag. HubSpot automatically canonicalizes URLs.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I did a few tests with it, and all it does is read back the value in the existing rel canonical tag.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 18:38:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-s-the-best-practice-for-pushing-a-rel-canonical-into-the/m-p/989907#M39437</guid>
      <dc:creator>tony5280</dc:creator>
      <dc:date>2024-06-10T18:38:14Z</dc:date>
    </item>
  </channel>
</rss>

