<?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: Hubl functions for multilingual site in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/655041#M29201</link>
    <description>&lt;P&gt;I don't know why, but I totally overlooked the "other language" blog in the field while filling the content.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;&amp;nbsp;Thank you so much for the help!&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2022 12:58:47 GMT</pubDate>
    <dc:creator>MSelles</dc:creator>
    <dc:date>2022-06-24T12:58:47Z</dc:date>
    <item>
      <title>Hubl functions for multilingual site</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/653693#M29185</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We are currently building the CMS for our customer, however, we came across an issue regarding using multi-languages in Hubl functions:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For the blog listing of a specific topic (or tag), we are using the Hubl function "blog_recent_tag_posts". This function will fetch all the blog posts containing a specific tag that we are specifying by the field "tag":&amp;nbsp;&lt;CODE class="" data-stringify-type="code"&gt;blog_recent_tag_posts('default', module.tag , 200)&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This seems to be working as it should on the primary language of the site, however, it does not work in a different language.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In our blog posts, we have the tag "Sustainability". We want to show all the blog posts containing "Sustainability" on the Dutch version of the topic page. Therefore, we created a translation for this tag named "Dutch-sustainability". This tag, however, does not fetch any data if we use the "blog_recent_tag_posts" function, while it should fetch the dutch blog posts. In addition, if a post contains the same tag for Dutch and English, only the English data can be used, meaning that the title, description etc. will not be shown in dutch.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;While debugging this issue, I used the function "blog_tags" and noticed that only the tags were returned in the primary language.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you tell me what is the best way to fetch all blog posts containing a tag in a specific language? I first would suspect adding an additional parameter to the function containing language, but this does not seem to be the case.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;CODE class="" data-stringify-type="code"&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 15:06:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/653693#M29185</guid>
      <dc:creator>MSelles</dc:creator>
      <dc:date>2022-06-22T15:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl functions for multilingual site</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654094#M29186</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/158006"&gt;@MSelles&lt;/a&gt;! Thanks for the interesting question. Let's see if we can get the conversation rolling for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/91608"&gt;@alyssamwilie&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/55480"&gt;@jonchim&lt;/a&gt;,&amp;nbsp;do y'all have any experience building out anything similar to what&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/158006"&gt;@MSelles&lt;/a&gt;&amp;nbsp;is trying to accomplish?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp; — Jaycee&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 22:42:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654094#M29186</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2022-06-22T22:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl functions for multilingual site</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654313#M29190</link>
      <description>&lt;P&gt;Hi Marc!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that using &lt;CODE&gt;'default'&lt;/CODE&gt; for the blog parameter could be causing an issue. Add an extra "Blog" type field to your module and replace &lt;CODE&gt;'default'&lt;/CODE&gt; with &lt;CODE&gt;module.blog&lt;/CODE&gt; like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;blog_recent_tag_posts(&lt;STRONG&gt;module.blog&lt;/STRONG&gt;, module.tag , 200)&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then select the corresponding language blog wherever you're using the module.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran a few quick tests using both default and selected blogs on both pages and blog listings and that seemed to do the trick.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A style="cursor: pointer; text-decoration: none; color: #000000;" href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank" rel="noopener"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank" rel="noopener"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank" rel="noopener"&gt;Contact&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 09:43:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654313#M29190</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2022-06-23T09:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl functions for multilingual site</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654705#M29196</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt; &lt;span class="lia-unicode-emoji" title=":raising_hands:"&gt;🙌&lt;/span&gt;&amp;nbsp; — Jaycee&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 19:57:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654705#M29196</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2022-06-23T19:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl functions for multilingual site</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654927#M29197</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for looking into this issue for me!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried your solution, but I'm not sure if we can use this. Multiple languages exist in the same blog. For instance:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MSelles_0-1656062585823.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/69292i827861158FD84D1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MSelles_0-1656062585823.png" alt="MSelles_0-1656062585823.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;These blog posts are all linked to the same blog (that has the same blog id). Using a field to get the blog will still result in trying to fetch the data from 1 blog for all languages. Or am I maybe missing something?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 09:25:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654927#M29197</guid>
      <dc:creator>MSelles</dc:creator>
      <dc:date>2022-06-24T09:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl functions for multilingual site</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654977#M29199</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/158006"&gt;@MSelles&lt;/a&gt;&amp;nbsp;- they're language variations of the same blog, but when you add the "Blog" field to the module it'll let you choose the different language variations. So I still think you need to choose the blog from the module if you're using it on a page.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my test, I have a language variation of a post under my Test Blog, the English post has a tag "test-tag" and the Spanish a tag "test-tag-es":&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-blog-with-two-language-post.jpg" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/69297i7C9FE1B16385C423/image-size/large?v=v2&amp;amp;px=999" role="button" title="test-blog-with-two-language-post.jpg" alt="test-blog-with-two-language-post.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under settings, I've set the page title for the English variation to "Test Blog (English)" and the Spanish variation to "Test Blog (Spanish)".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My test module has two fields (a Blog field blog and a Tag field tag) and the following code:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;h2&amp;gt;Function using "default" ()&amp;lt;/h2&amp;gt;
{% set default_posts = blog_recent_tag_posts('default', module.tag , 200) %}
&amp;lt;ul&amp;gt;
  {% for post in default_posts %}
  &amp;lt;li&amp;gt;{{ post.name }}&amp;lt;/li&amp;gt;
  {% endfor %}
&amp;lt;/ul&amp;gt;

&amp;lt;br&amp;gt;

&amp;lt;h2&amp;gt;Function selecting blog&amp;lt;/h2&amp;gt;
{% set blog = blog_by_id(module.blog) %}
&amp;lt;h3&amp;gt;module.blog = {{ blog.html_title }} (ID: {{ module.blog }})&amp;lt;/h3&amp;gt;
{% set blog_posts = blog_recent_tag_posts(module.blog, module.tag , 200) %}
&amp;lt;ul&amp;gt;
  {% for post in blog_posts %}
  &amp;lt;li&amp;gt;{{ post.name }}&amp;lt;/li&amp;gt;
  {% endfor %}
&amp;lt;/ul&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I test it on a page using the English variation of the blog, no posts with "test-tag-es" come up either under the "default" or the selected blog (because "Test Blog - Spanish" is not my default blog):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-blog-english.jpg" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/69298iE8F954D9077DC727/image-size/large?v=v2&amp;amp;px=999" role="button" title="test-blog-english.jpg" alt="test-blog-english.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I select "Test Blog - Spanish", the post does appear under the function that uses module.blog:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-blog-spanish.jpg" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/69299i15C61EA42629A035/image-size/large?v=v2&amp;amp;px=999" role="button" title="test-blog-spanish.jpg" alt="test-blog-spanish.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I think you need to specify the blog if you're using it on a page.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, if you're using the module on the Blog Listings or Blog Posts pages, the "default" should default to that specific language variation and it'll work. It did in my tests.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A style="cursor: pointer; text-decoration: none; color: #000000;" href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 11:04:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/654977#M29199</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2022-06-24T11:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl functions for multilingual site</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/655041#M29201</link>
      <description>&lt;P&gt;I don't know why, but I totally overlooked the "other language" blog in the field while filling the content.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;&amp;nbsp;Thank you so much for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 12:58:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-functions-for-multilingual-site/m-p/655041#M29201</guid>
      <dc:creator>MSelles</dc:creator>
      <dc:date>2022-06-24T12:58:47Z</dc:date>
    </item>
  </channel>
</rss>

