CMS Development

IPars
Participant

Custom menu to switch blog language version

I’m trying to develop a blog template with navigation styled similar to my corporate website, which includes an English/French language switching link:

blog-secondary-menu.jpg

I’m a HubSpot and HubL novice but have realized the menu module doesn’t allow for the if/then logic needed to check for another language version. I looked at some info for the HubL Menu Tag (https://developers.hubspot.com/docs/cms/building-blocks/menus-and-navigation#:~:text=like%20mega%2Dm...), and it looks like it might do the trick, however I’m not sure if it’s possible using HubL code to add the if/then logic. For reference the language syntax for my blog is as follows:

Or maybe the HubL Menu Tag won’t work because no HubL code exists to add the logic, and I need to go even more custom, i.e., a menu using the menu() function?

 

Or... could what I want need still be done through a menu module, but with some wrapping html added? Below is the language switcher html creating through a menu module and an Advanced Menu... does HubL code exist to add some logic here that once clicked the French version of the blog would appear (and similarly for English)?

 

IPars_0-1677792245505.png

 

 

 

Any advice is welcome. Thanks.

0 Upvotes
1 Reply 1
Stephanie-OG
Key Advisor

Custom menu to switch blog language version

I think this post is pretty much a duplicate of Wrapping HTML in a menu module to change blog language version?

 


Stephanie O'Gay Garcia

Freelance HubSpot CMS Developer

Website | Contact