We have an upcoming event (trade show) where we are going to have many sales reps available for meeting bookings. As language skills are a challenge, we have to make sure that visitors from e.g. Germany books a meeting with our German sales rep, the same for Italy, France, etc - 12 different reps in total.
Our current solution (not sexy at all) is to make 12 different landing pages for meeting bookings. To have our web visitors select, they get a menu of 12 links with flags to indicate the language.
Otherwise, how are you sending contacts to this landing page? We came up with a solution to dynamically populate content into a landing page using HUBL based on URL parameters. As such you could use the parameter to show different blocks of text based on the parameter you pass in the URL e.g. https://examplesite.com/landing-page?lng=de
You would then place the following code in your landing page:
{% if request.query is string_containing "lng" %}
{% set lng_var = request.query_dict.get('lng') %}
{% endif %}
{% if lng_var == "de" %}
<strong>Demo1:</strong> Dies ist mein erster Absatz, der von HUBL mithilfe der Variablen lng_var in der URL generiert wurde. Da lng_var gleich 'de' ist, hat der Code diesen deutschen Demo1-Absatztext gezogen.
{% elif lng_var == "fr"%}
<strong>Demo2:</strong> Ceci est mon premier paragraphe généré par HUBL en utilisant la variable lng_var dans l'URL. Comme lng_var est égal à 'de', le code a tiré ce texte de paragraphe allemand demo2.
{% elif lng_var == "es" %}
<strong>Demo3:</strong> Este es mi primer párrafo generado por HUBL usando la variable lng_var en la URL. Como lng_var es igual a 'de', el código ha extraído este texto de párrafo demo1 alemán.
{% else %}
<strong>Default:</strong> This is my <strong>default</strong> English paragraph text which is used when lng_var isn't present or doesn't have a value that matches the options in our HUBL code.
{% endif %}
You can place this code in a rich text or Custom HTML module, we also found that it works in some Heading modules and page title and meta description fields. This code grabs the value of the lng parameter and stores it in the lng_var variable. We then test if the lng_var variable matches any of our expected languages and when it does we output our text in that language.
Matthew Shepherd
Freelance HubSpot Consultant CRM Consultant | SEO Specialist
Otherwise, how are you sending contacts to this landing page? We came up with a solution to dynamically populate content into a landing page using HUBL based on URL parameters. As such you could use the parameter to show different blocks of text based on the parameter you pass in the URL e.g. https://examplesite.com/landing-page?lng=de
You would then place the following code in your landing page:
{% if request.query is string_containing "lng" %}
{% set lng_var = request.query_dict.get('lng') %}
{% endif %}
{% if lng_var == "de" %}
<strong>Demo1:</strong> Dies ist mein erster Absatz, der von HUBL mithilfe der Variablen lng_var in der URL generiert wurde. Da lng_var gleich 'de' ist, hat der Code diesen deutschen Demo1-Absatztext gezogen.
{% elif lng_var == "fr"%}
<strong>Demo2:</strong> Ceci est mon premier paragraphe généré par HUBL en utilisant la variable lng_var dans l'URL. Comme lng_var est égal à 'de', le code a tiré ce texte de paragraphe allemand demo2.
{% elif lng_var == "es" %}
<strong>Demo3:</strong> Este es mi primer párrafo generado por HUBL usando la variable lng_var en la URL. Como lng_var es igual a 'de', el código ha extraído este texto de párrafo demo1 alemán.
{% else %}
<strong>Default:</strong> This is my <strong>default</strong> English paragraph text which is used when lng_var isn't present or doesn't have a value that matches the options in our HUBL code.
{% endif %}
You can place this code in a rich text or Custom HTML module, we also found that it works in some Heading modules and page title and meta description fields. This code grabs the value of the lng parameter and stores it in the lng_var variable. We then test if the lng_var variable matches any of our expected languages and when it does we output our text in that language.
Matthew Shepherd
Freelance HubSpot Consultant CRM Consultant | SEO Specialist