CMS Development

DM2
Mitglied

Serving different content for different domains

lösung

Hello - Is this possible on Hubspot?

 

I'm aware that using Smart Content I can vary content by Country (IP) but is is possible to vary content by domain...so for example:

 

www.mywebsite.com

www.mywebsite.nz

www.mywebsite.au

www.mywebsite.be

 

all serve a different variant of a module or page?

0 Upvotes
1 Akzeptierte Lösung
Gonzalo
Lösung
Stratege/Strategin | Diamond Partner
Stratege/Strategin | Diamond Partner

Serving different content for different domains

lösung

I see, yes you are right.


If you are in the situation where using a common partial/global module or group across different domains/brands or whatever is the case. I like to use a method I figured out a few years ago. You can check it here:

https://designers.hubspot.com/code-gallery/entry/founders/gonzalotorreras-hs-multilingual-menu-custo...

The idea is to use the slug variable to filter over the content and display the right one.
Now, for the module where you want to save all the content variations, you will create a repeatable group (I use it with the internal key lang) and a required simple text field with the key lang_slug that will save the value of the slug to compare with (string_startingwith).

Then you will add as many fields needed for the content to be filtered.

 

This case assumes the lang propose and uses for example en/ es/ etc as the lang_slug code values. In your case, you want to swap the slug variable for the domain check (for example content.resolved_domain) and use the lang_slug values that match it.

 

If you have more questions and you are in the dev slack, I am happy to guide you.

 

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting

Lösung in ursprünglichem Beitrag anzeigen

5 Antworten
Gonzalo
Stratege/Strategin | Diamond Partner
Stratege/Strategin | Diamond Partner

Serving different content for different domains

lösung

Hi there,

 

It will depend on what do you exactly want to achieve, where to place that and if it will be language-dependent.

For example, if you want to use those domains to split the content based on the language, Hubspot provides a lot of tools to create page variations, including the global header & footer.

 

It would be completely different and complex if you have several brands serving common languages. And will require custom development to achieve it.

 

If you can provide some extra info about what are you trying to achieve I am happy to guide you.

 

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
DM2
Mitglied

Serving different content for different domains

lösung

thanks @Gonzalo yes it's not about language variants, it's a case of several different domains coming in. They would all be in english but I would want to serve some elements differently.  For example, a 'rack of partner logos' my be different for each domain.

It looks like I can't use smart content for this?

But perhaps it's more a case of using hubl if statements to capture the url and display a different module/partial?

 

Thanks for any advice.

0 Upvotes
Gonzalo
Lösung
Stratege/Strategin | Diamond Partner
Stratege/Strategin | Diamond Partner

Serving different content for different domains

lösung

I see, yes you are right.


If you are in the situation where using a common partial/global module or group across different domains/brands or whatever is the case. I like to use a method I figured out a few years ago. You can check it here:

https://designers.hubspot.com/code-gallery/entry/founders/gonzalotorreras-hs-multilingual-menu-custo...

The idea is to use the slug variable to filter over the content and display the right one.
Now, for the module where you want to save all the content variations, you will create a repeatable group (I use it with the internal key lang) and a required simple text field with the key lang_slug that will save the value of the slug to compare with (string_startingwith).

Then you will add as many fields needed for the content to be filtered.

 

This case assumes the lang propose and uses for example en/ es/ etc as the lang_slug code values. In your case, you want to swap the slug variable for the domain check (for example content.resolved_domain) and use the lang_slug values that match it.

 

If you have more questions and you are in the dev slack, I am happy to guide you.

 

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
Kirsten8686
Teilnehmer/-in

Serving different content for different domains

lösung

Hello Gonzalo, 

I think we're trying to do something similar here. We currently have a UK and US version of our menu. But when I share a UK link with one of our US colleagues it is not showing her the US version.

Would implementing the above solution resolve this? 

Thanks, 

Kirsty

0 Upvotes
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Serving different content for different domains

lösung

@Gonzalo 👋  

Do you have any thoughts on this?

0 Upvotes