<?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 Re: Get current page URL slug in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256423#M11253</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using {{ request.path }} will return the entire path from the URL. I would try and use the split filter found in the HubL docs here.&amp;nbsp;&lt;A href="https://designers.hubspot.com/docs/hubl/hubl-supported-filters" target="_blank"&gt;https://designers.hubspot.com/docs/hubl/hubl-supported-filters&lt;/A&gt;. To split on the '/' and then return just the part of the URL that you want to use.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 14:52:15 GMT</pubDate>
    <dc:creator>jzilch</dc:creator>
    <dc:date>2019-03-01T14:52:15Z</dc:date>
    <item>
      <title>Get current page URL slug</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256422#M11252</link>
      <description>&lt;P&gt;I want to get the slug from the current page. Do do this I'm using `{{ request.path }}&lt;SPAN&gt;`.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Currently, when executing&amp;nbsp;`{{ request.path }}` it'll show me the slug as '/en/pro-test`. How can I get it so that it only shows me `/pro-test`?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:01:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256422#M11252</guid>
      <dc:creator>Amit_95</dc:creator>
      <dc:date>2019-03-01T14:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get current page URL slug</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256423#M11253</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using {{ request.path }} will return the entire path from the URL. I would try and use the split filter found in the HubL docs here.&amp;nbsp;&lt;A href="https://designers.hubspot.com/docs/hubl/hubl-supported-filters" target="_blank"&gt;https://designers.hubspot.com/docs/hubl/hubl-supported-filters&lt;/A&gt;. To split on the '/' and then return just the part of the URL that you want to use.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:52:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256423#M11253</guid>
      <dc:creator>jzilch</dc:creator>
      <dc:date>2019-03-01T14:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get current page URL slug</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256434#M11254</link>
      <description>&lt;P&gt;So `{{ request.path|split('/') }}`?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this approach, it prints `/en/[en,%20pro-test]`&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 15:40:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256434#M11254</guid>
      <dc:creator>Amit_95</dc:creator>
      <dc:date>2019-03-01T15:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get current page URL slug</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256440#M11255</link>
      <description>&lt;P&gt;I would also set the second parameter of the split filter to display how many times it should split the URL. Also you will need to return the piece of the URL that you want to use. In this case you can use |last as the piece of the URL of the last item in your sequence.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{{ request.path|split('/', 2)|last }}&lt;/PRE&gt;
&lt;P&gt;Something like the above should work for you&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 16:03:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256440#M11255</guid>
      <dc:creator>jzilch</dc:creator>
      <dc:date>2019-03-01T16:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get current page URL slug</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256443#M11256</link>
      <description>&lt;P&gt;Ah, we're getting there!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That now spits out "pro-test". However, I have two translations of this page (English and French). I currently have ...&lt;/P&gt;&lt;PRE&gt;fr/{{ request.path|split('/', 2)|last }}&lt;/PRE&gt;&lt;P&gt;... added to the end of my domain, but it apends "?hsLang=en" to the URL (which results in a 404). Is there a way to remove the last bit too? It's not defined in my code so guessing it's HubSpot generated.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 16:11:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/256443#M11256</guid>
      <dc:creator>Amit_95</dc:creator>
      <dc:date>2019-03-01T16:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Get current page URL slug</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/450033#M23733</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/64311"&gt;@Amit_95&lt;/a&gt; I don't know if you found your awnser, but to remove the ?hsLang=en, you can disable the 'Language Specific Redirects'.&lt;/P&gt;
&lt;P&gt;You can check out the documentation at:&lt;BR /&gt;&lt;A href="https://knowledge.hubspot.com/domains-and-urls/edit-a-domain-s-language-setting" target="_blank"&gt;https://knowledge.hubspot.com/domains-and-urls/edit-a-domain-s-language-setting&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this solutions works for you.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 13:57:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/450033#M23733</guid>
      <dc:creator>Indra</dc:creator>
      <dc:date>2021-06-22T13:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get current page URL slug</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/920612#M37822</link>
      <description>&lt;P&gt;If anyone is finding this on the google... this works&amp;nbsp;{{content.slug}}&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 22:05:57 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-current-page-URL-slug/m-p/920612#M37822</guid>
      <dc:creator>Jake_Lett</dc:creator>
      <dc:date>2024-02-10T22:05:57Z</dc:date>
    </item>
  </channel>
</rss>

