GDPR Deadline (25th May 2018)

With the deadline approaching, HubSpot has released new features and a playbook to make it easier for you and your team to comply. Please note that while these features live in HubSpot, your legal team is best placed to give you compliance advice for your specific situation.

Translate - language specific header and footer

New Contributor

Hi, I need some tips regarding translation settings. 
The icon below is can be found on your Website Pages. It is used to clone a specific page to multiple languages.  For easier management. I will refer to this as the function.   

globe.png

  

 

The need:

Our site currently has three languages (more languages will be added soon) and one of them has an additional link in the header (top - navigation) and extra content in the footer.  

  

 

Code example 

 

 

The problem: 
To use the function every page needs one Template. To solve the need the site currently uses 1 set of Templates for each language.  Making the page bodyinternationalin the Templates is no brainer. But how do convert the header and the footer



Does this even make any sense to you guys or do I need to rephrase?

Is this even possible? Or do I need to rethink the sites  structure?

2 Replies
Regular Contributor

Hi there,

 

I was looking into the same issue. Don't know if you were able to solve this already? 

 

The menu issue can be solved by using HUBL code:

 

{# If statements for sites using language code subdirectories #}
{% if (content.slug is string_startingwith "en/") or (content.slug =="en") %}
{% menu "my_menu" site_map_name='Menu EN', overrideable=False, root_type='site_root', flyouts='true', max_levels='2', flow='horizontal', label='Advanced Menu' %}
{% else %}

{% menu "my_menu" site_map_name='Menu Base', overrideable=False, root_type='site_root', flyouts='true', max_levels='2', flow='horizontal', label='Advanced Menu' %}
{% endif %}

 

With this, you can generate the language specific contents. 

 

Best,

Janek 

Reply
0 Upvotes
New Contributor

Hi, is it possible to set site_map_name param from a variable instead of performing the if/else statements? Something like:

 

site_map_name=requiredMenu, where requiredMenu us a string variable? I get the default menu with the code blellow

 

{% set requiredMenu = 'Required Menu Tree' %}
{menu "my_menu" site_map_name=requiredMenu}
{menu "my_menu" site_map_name="" ~ requiredMenu}
{menu "my_menu" site_map_name="" ~ requiredMenu ~ ""}
{menu "my_menu" site_map_name=["", requiredMenu]|join}
Reply
0 Upvotes