<?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: Include Language Switcher In Header in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1034089#M40483</link>
    <description>&lt;P&gt;&amp;nbsp;quick look at the code on the page shows me a partial "&lt;SPAN&gt;Ingentis_May2023/templates/partials/header-no-navigation.html"&lt;BR /&gt;&lt;BR /&gt;That's where you'd want to put your language switcher.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To be honest the code form your custom module looks like it overcomplicates things greatly. It looks like you have to manually set the link. There's also a provision for if the link is an email. Why would it be an email??&lt;BR /&gt;&lt;BR /&gt;For reference here is the code from the Hubspot Boilerplate that simply includes the default Hubspot Language Switcher. The switcher her will show up automatically if the page has translations.&lt;/SPAN&gt;&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;&lt;LI-CODE lang="markup"&gt; {% if content.translated_content.values()|selectattr("published")|length or is_listing_view and group.translations %}
          &amp;lt;div class="header__language-switcher header--element"&amp;gt;
            &amp;lt;div class="header__language-switcher--label"&amp;gt;
              {% module "language-switcher"
                path="@hubspot/language_switcher",
                label="Language switcher",
                display_mode="localized"
              %}
              &amp;lt;div class="header__language-switcher--label-current"&amp;gt; {{ locale_name(locale) }}&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/div&amp;gt;
        {% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And if you still needed to customize the switcher more instead of using the default Hubspot module you could use something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;ul class="menu__submenu menu__submenu--level-2 no-list"&amp;gt;
   &amp;lt;li class="lang-item"&amp;gt;
&amp;lt;a class="lang-link" href="#"&amp;gt;{{ locale.language }}&amp;lt;/a&amp;gt;
   &amp;lt;/li&amp;gt;
{% for item in content.translated_content|sort(False, False, 'language') %}  
   &amp;lt;li class="lang-item"&amp;gt;
&amp;lt;a class="lang-link" href="//{{ item.resolvedDomain }}/{{ item.slug }}"&amp;gt;{{ item.language }}&amp;lt;/a&amp;gt;
   &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;&lt;BR /&gt;That'll auto detect the translations so no need for manually adding links etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 16:39:24 GMT</pubDate>
    <dc:creator>BarryGrennan</dc:creator>
    <dc:date>2024-08-29T16:39:24Z</dc:date>
    <item>
      <title>Include Language Switcher In Header</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1033856#M40474</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have a landing page template that was created during our HubSpot setup. This template does not include a language switcher but it would definitely make sense to have one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We also have a "website template" but that is in our old CI and we are not using it. However, it includes the following code for a language switcher:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;&amp;lt;div class="language-switcher mobile-language-switcher"&amp;gt;
{% module "language_switcher" path="../../modules/language-switcher", label="Language Switcher" %}
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The code for the language switcher module is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;&amp;lt;div class="language-switcher-wrapper"&amp;gt;
	&amp;lt;button class="language-selector"&amp;gt;
		&amp;lt;i class="fa-solid fa-earth-europe" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;
		&amp;lt;span class="language-text"&amp;gt;
			{{ module.english_ }} &amp;lt;/span&amp;gt;
	&amp;lt;/button&amp;gt;
	&amp;lt;ul class="dropdown-menu"&amp;gt;
		{% for item in module.language_items %}
		&amp;lt;li class="dropdown-item dropdown-item-reset px-3"&amp;gt;
			{% set href = item.language_link.url.href %}
			{% if item.language_link.url.type is equalto "EMAIL_ADDRESS" %}
			{% set href = "mailto:" + href %}
			{% endif %}
			&amp;lt;a href="{{ href }}"
				 {% if item.language_link.open_in_new_tab %}target="_blank"{% endif %}
				 {% if item.language_link.rel %}rel="{{ item.language_link.rel }}"{% endif %}
				 &amp;gt;
				&amp;lt;span&amp;gt;{{ item.language_text }}&amp;lt;/span&amp;gt;
			&amp;lt;/a&amp;gt;
		&amp;lt;/li&amp;gt;
		{% endfor %}
	&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The page on which I would like to add the language switcher module is the following:&amp;nbsp;&lt;A href="https://lp.ingentis.com/events" target="_blank"&gt;https://lp.ingentis.com/events&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can someone help me figure out where to insert the language switcher code for it to appear in the header section of this page?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Theresa&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 09:23:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1033856#M40474</guid>
      <dc:creator>Ingentis</dc:creator>
      <dc:date>2024-08-29T09:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Include Language Switcher In Header</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1034029#M40480</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/584918"&gt;@Ingentis&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you confirm if the site page and landing page templates are within the same theme?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 15:06:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1034029#M40480</guid>
      <dc:creator>GiantFocal</dc:creator>
      <dc:date>2024-08-29T15:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Include Language Switcher In Header</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1034089#M40483</link>
      <description>&lt;P&gt;&amp;nbsp;quick look at the code on the page shows me a partial "&lt;SPAN&gt;Ingentis_May2023/templates/partials/header-no-navigation.html"&lt;BR /&gt;&lt;BR /&gt;That's where you'd want to put your language switcher.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To be honest the code form your custom module looks like it overcomplicates things greatly. It looks like you have to manually set the link. There's also a provision for if the link is an email. Why would it be an email??&lt;BR /&gt;&lt;BR /&gt;For reference here is the code from the Hubspot Boilerplate that simply includes the default Hubspot Language Switcher. The switcher her will show up automatically if the page has translations.&lt;/SPAN&gt;&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;&lt;LI-CODE lang="markup"&gt; {% if content.translated_content.values()|selectattr("published")|length or is_listing_view and group.translations %}
          &amp;lt;div class="header__language-switcher header--element"&amp;gt;
            &amp;lt;div class="header__language-switcher--label"&amp;gt;
              {% module "language-switcher"
                path="@hubspot/language_switcher",
                label="Language switcher",
                display_mode="localized"
              %}
              &amp;lt;div class="header__language-switcher--label-current"&amp;gt; {{ locale_name(locale) }}&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/div&amp;gt;
        {% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And if you still needed to customize the switcher more instead of using the default Hubspot module you could use something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;ul class="menu__submenu menu__submenu--level-2 no-list"&amp;gt;
   &amp;lt;li class="lang-item"&amp;gt;
&amp;lt;a class="lang-link" href="#"&amp;gt;{{ locale.language }}&amp;lt;/a&amp;gt;
   &amp;lt;/li&amp;gt;
{% for item in content.translated_content|sort(False, False, 'language') %}  
   &amp;lt;li class="lang-item"&amp;gt;
&amp;lt;a class="lang-link" href="//{{ item.resolvedDomain }}/{{ item.slug }}"&amp;gt;{{ item.language }}&amp;lt;/a&amp;gt;
   &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;&lt;BR /&gt;That'll auto detect the translations so no need for manually adding links etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 16:39:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1034089#M40483</guid>
      <dc:creator>BarryGrennan</dc:creator>
      <dc:date>2024-08-29T16:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Include Language Switcher In Header</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1034317#M40484</link>
      <description>&lt;P&gt;Hi Barry,&lt;/P&gt;&lt;P&gt;First of all, thank you so much for looking into this. To be honest, I don't know why the language switcher was coded that way. I think we should be fine with the default one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the header-no-navigation code. Could you tell me where exactly I'd need to insert the code that you sent?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="custom-header lp-header"&amp;gt;
	&amp;lt;header class="site-header"&amp;gt;
		&amp;lt;div class="header-inner"&amp;gt;
			&amp;lt;div class="header-row"&amp;gt;
				&amp;lt;div class="header-logo"&amp;gt;
					{% module_block module "header_logo" path="@hubspot/rich_text" label="Header Logo" %}
					{% module_attribute "html" %}
					&amp;lt;a href="https://www.ingentis.com/"&amp;gt;
						&amp;lt;svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 110" class="navbar-brand-image d-block fill-svg-current flex-svg-img is-portrait"&amp;gt;
							&amp;lt;defs&amp;gt;
								&amp;lt;style&amp;gt;
									.cls-1 {
										fill: #fff;
									}

									.cls-2 {
										fill: #eaf469;
									}
								&amp;lt;/style&amp;gt;
							&amp;lt;/defs&amp;gt;
							&amp;lt;g&amp;gt;
								&amp;lt;path class="cls-1" d="M8.84,20.47A6.83,6.83,0,0,0,2,27.3V75.15a6.84,6.84,0,1,0,13.67,0V27.3A6.83,6.83,0,0,0,8.84,20.47Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;circle class="cls-2" cx="8.84" cy="9.06" r="6.84"&amp;gt;&amp;lt;/circle&amp;gt;
								&amp;lt;path class="cls-1" d="M252.22,20.46a30.8,30.8,0,0,0-30.76,30.76V75.13a6.84,6.84,0,0,0,13.68,0V51.22a17.08,17.08,0,1,1,34.16,0v24a6.84,6.84,0,0,0,13.68,0v-24A30.8,30.8,0,0,0,252.22,20.46Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;path class="cls-1" d="M52,20.46A30.8,30.8,0,0,0,21.26,51.22V75.13a6.84,6.84,0,0,0,13.67,0V51.22a17.09,17.09,0,1,1,34.17,0v24a6.84,6.84,0,0,0,13.67,0v-24A30.79,30.79,0,0,0,52,20.46Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;path class="cls-1" d="M315.54,21H302.48V9.1a6.84,6.84,0,0,0-13.67,0V75.24a6.84,6.84,0,1,0,13.67,0V34.65h13.06a6.84,6.84,0,1,0,0-13.67Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;path class="cls-1" d="M333.85,20.53A6.84,6.84,0,0,0,327,27.37V75.22a6.84,6.84,0,1,0,13.67,0V27.37A6.83,6.83,0,0,0,333.85,20.53Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;circle class="cls-2" cx="333.85" cy="9.13" r="6.84"&amp;gt;&amp;lt;/circle&amp;gt;
								&amp;lt;path class="cls-1" d="M378,44.5h0c-.48,0-4.21,0-13.65,0a5.26,5.26,0,0,1-5.25-5.25,4.91,4.91,0,0,1,5.25-4.9h22.85a6.72,6.72,0,0,0,6.8-6.62,6.8,6.8,0,0,0-6.8-6.79H364.31c-10.54,0-18.8,8-18.8,18.31a18.87,18.87,0,0,0,18.8,18.88h0c.5,0,4.25-.05,13.65,0a5.49,5.49,0,0,1,5.6,5.37c0,3.13-2.82,4.77-5.6,4.77H355.44a6.79,6.79,0,0,0,0,13.58H378c10.66,0,19-8.06,19-18.35A19,19,0,0,0,378,44.5Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;path class="cls-1" d="M118.88,82a30.75,30.75,0,0,0,30.71-30.48,6.41,6.41,0,0,0,.17-1.46V27a6.5,6.5,0,0,0-13-.64A30.71,30.71,0,1,0,118.88,82Zm0-48.44a17.73,17.73,0,1,1-17.73,17.72A17.75,17.75,0,0,1,118.88,33.51Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;path class="cls-2" d="M142.71,85.21a6.84,6.84,0,1,0,7.35,6.28A6.83,6.83,0,0,0,142.71,85.21Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;path class="cls-1" d="M124.29,91c-9.22,2.52-19.07,1.23-25.1-3.27a6.5,6.5,0,0,0-7.77,10.41c6.26,4.67,14.63,7.12,23.45,7.12a48.91,48.91,0,0,0,12.83-1.72A6.5,6.5,0,0,0,124.29,91Z"&amp;gt;&amp;lt;/path&amp;gt;
								&amp;lt;path class="cls-1" d="M186.05,20.41a30.75,30.75,0,0,0-30.71,30.71h0c0,17.64,15.75,30.12,30.46,30.7h.62a31.45,31.45,0,0,0,13.7-3.42,6.49,6.49,0,1,0-6-11.49,18.93,18.93,0,0,1-7.77,1.92c-5.75-.23-13.51-4.24-16.61-11.23h40.57a6.49,6.49,0,0,0,6.49-6.5h0A30.74,30.74,0,0,0,186.05,20.41Zm0,13a17.76,17.76,0,0,1,16.49,11.23h-33A17.76,17.76,0,0,1,186.05,33.4Z"&amp;gt;&amp;lt;/path&amp;gt;
							&amp;lt;/g&amp;gt;
						&amp;lt;/svg&amp;gt; 
					&amp;lt;/a&amp;gt;
					{% end_module_attribute %}
					{% end_module_block %}
				&amp;lt;/div&amp;gt;
			&amp;lt;/div&amp;gt;
		&amp;lt;/div&amp;gt;
	&amp;lt;/header&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Theresa&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 06:40:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Include-Language-Switcher-In-Header/m-p/1034317#M40484</guid>
      <dc:creator>Ingentis</dc:creator>
      <dc:date>2024-08-30T06:40:23Z</dc:date>
    </item>
  </channel>
</rss>

