<?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: Using a HubL variable in an Advanced Menu in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1603#M173</link>
    <description>&lt;P&gt;Hi Ty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to clarify your instructions, are you suggesting I take the rendered raw HTML from an&amp;nbsp;advanced menu, and paste it into a "Custom HTML" Global Module and then update the markup manually to sprinkle in&amp;nbsp;HubL?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 20:11:02 GMT</pubDate>
    <dc:creator>spalumbo</dc:creator>
    <dc:date>2016-11-28T20:11:02Z</dc:date>
    <item>
      <title>Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1595#M170</link>
      <description>&lt;P&gt;I have setup a code file that has some global url variables and common macros that we would like to use across our site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the template I would like to use this file, I have included it in the template HEAD&lt;/P&gt;&lt;PRE&gt;{% import "custom/page/web_page_basic/environment.html" as env %}&lt;/PRE&gt;&lt;P&gt;There is a global component used on this template that contains an Advanced Menu. I'd like one of the Advance Menu items to navigate using a variable:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Variable used in Advanced Menu" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/464i1F68BABAB422FEEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2016-11-28 at 2.12.14 PM.png" alt="Variable used in Advanced Menu" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Variable used in Advanced Menu&lt;/span&gt;&lt;/span&gt;﻿&lt;BR /&gt;However when the page is rendered, the variable is treated as a literal and is not resolved.&lt;/P&gt;&lt;PRE&gt;&amp;lt;a href="https://{{env.app_url}}/sign-in"&amp;gt;Sign In&amp;lt;/a&amp;gt;&lt;/PRE&gt;&lt;P&gt;Any help on this would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 19:16:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1595#M170</guid>
      <dc:creator>spalumbo</dc:creator>
      <dc:date>2016-11-28T19:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1597#M171</link>
      <description>&lt;P&gt;Hi Spalumbo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We were attempting to do this aswell on HubSpot Academy, after a few variations and trial and error, we found it was better for us to do this via a global module. What we ended up doing was creating the standard advanced menu wireframe (&lt;A href="http://designers.hubspot.com/docs/cos/hubspot-menu-markup" target="_self"&gt;you can get the code from here&lt;/A&gt;). Then you can go to &lt;STRONG&gt;Content &amp;gt; Content Settings &amp;gt; Global Content &amp;gt;&amp;nbsp;Add New Global Module&lt;/STRONG&gt; and paste your wireframe.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We were using this to deal with localization URLs and languages, what we would do is set our 'root-domain' for the language as a variable. For example:&lt;/P&gt;
&lt;PRE&gt;{% set root_domain = 'http://www.hubspot.com' %}&lt;/PRE&gt;
&lt;P&gt;And then in our navigation's wireframe, we inputted it as you would with a normal HubL.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;li&amp;gt;&amp;lt;a href="{{ root_domain }}/link1"&amp;gt;Link 1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href="{{ root_domain }}/link2"&amp;gt;Link 2&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href="{{ root_domain }}/link3"&amp;gt;Link 3&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Perhaps this could help you solve your issue as well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 19:31:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1597#M171</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2016-11-28T19:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1603#M173</link>
      <description>&lt;P&gt;Hi Ty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to clarify your instructions, are you suggesting I take the rendered raw HTML from an&amp;nbsp;advanced menu, and paste it into a "Custom HTML" Global Module and then update the markup manually to sprinkle in&amp;nbsp;HubL?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 20:11:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1603#M173</guid>
      <dc:creator>spalumbo</dc:creator>
      <dc:date>2016-11-28T20:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1604#M174</link>
      <description>&lt;P&gt;Hi Spalumbo,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yep! That's exactly what I was saying. When a HubL variable prints itself, it's usually a good indication that your variable is not being parsed by HubL, and the advanced menu is reading it as plain text, rather than a function. As long as you keep the class and id names the same, the menu should stay responsive to your HubSpot boiler plate's CSS, but since it's now in a module, HubL will be able to read/replace your vairables! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 20:17:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1604#M174</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2016-11-28T20:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1605#M175</link>
      <description>&lt;P&gt;Hi Ty,&lt;/P&gt;&lt;P&gt;I really appreciate your help on this. However, I don't think this is a sustanable solution for the following reasons:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Doing this would put my new components at risk for the future if hubspot ever decides to change those classes/ids.&lt;/LI&gt;&lt;LI&gt;I lose the gui for making updates, which makes the component easier to break when non-technical people are making updates.&lt;/LI&gt;&lt;LI&gt;I need HubL tag interpolation on many more global components (such as CTA, etc...). As a result, I would be forking many of the ready built hubspot modules just to use&amp;nbsp;HubL.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Perhaps I can make a feature request to enable HubL variables in hubspot modules?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 20:28:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1605#M175</guid>
      <dc:creator>spalumbo</dc:creator>
      <dc:date>2016-11-28T20:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1623#M180</link>
      <description>&lt;P&gt;Hey Spalumbo,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I consulted a couple colleagues&amp;nbsp;to just triple check whether this would be possible or not and I was told it is not currently a feature. My advice would be to &lt;A href="https://community.hubspot.com/t5/forums/postpage/board-id/HubSpot_Ideas" target="_self"&gt;submit it as a feature request or an idea,&lt;/A&gt; but as of right now, the best way to use HubL within your menu is to build it out in raw html, and if you use a custom module, you can still keep the drag and drop functionality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do end up submitting an idea, I would link back to this post so it can help our devs get background knowledge on the current situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out!&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 22:46:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1623#M180</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2016-11-28T22:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1624#M181</link>
      <description>&lt;P&gt;There is a way to do what you want to do, well sort of!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use HUBL to create a menu in a HTML module (Not a HUBL module)&lt;/P&gt;&lt;PRE&gt;{% menu "my_menu2" site_map_name='My Menu', overrideable=False, root_type='site_root', flyouts='true', max_levels='2', flow='horizontal', label='Advanced Menu' %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then define your variables in the head section under Edit &amp;gt; Edit Head and not in a template module.&lt;/P&gt;&lt;PRE&gt;{% set my_menu_link_1 = "www.google.com" %}&lt;/PRE&gt;&lt;P&gt;I say "sort of" as it doesn't work using the import function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The menu links will include the variable (&lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt;) and not the token {{ my_menu_link_1 }}&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 22:55:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1624#M181</guid>
      <dc:creator>ndwilliams3</dc:creator>
      <dc:date>2016-11-28T22:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1625#M182</link>
      <description>&lt;P&gt;I tested this again and it does work in the template if you define the variables in a separate module before the HUBL menu code. You may play around with macros and imports to see if you can get it to work.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 23:05:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1625#M182</guid>
      <dc:creator>ndwilliams3</dc:creator>
      <dc:date>2016-11-28T23:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1666#M185</link>
      <description>&lt;P&gt;&lt;SPAN&gt;ndwilliams3's solution comes the closest to what I was asking for so I'm going to mark it as accepted.&lt;BR /&gt;&lt;BR /&gt;I'm also going to follow Ty's suggestion and submit an idea to support using variables in hubspot provided global modules.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks everyone!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 14:53:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/1666#M185</guid>
      <dc:creator>spalumbo</dc:creator>
      <dc:date>2016-11-29T14:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using a HubL variable in an Advanced Menu</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/195633#M6586</link>
      <description>&lt;PRE&gt;{% menu "my_menu", id="456", site_map_name='Default', overrideable=False, root_type='site_root', flyouts='true', max_levels='2', flow='horizontal', label='Advanced Menu' %}&lt;/PRE&gt;&lt;P&gt;^^This is a copy of what I am using in my html document. The menu name is 'Default'^^&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see that you have used the HubL menu module.&amp;nbsp; I would like to reference a menu I created on the Hubspot content page, do you have any suggestions about doing so. From what I have seen the site_map_name attribute should be the way to go but I seem to be doing something wrong.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 19:32:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-a-HubL-variable-in-an-Advanced-Menu/m-p/195633#M6586</guid>
      <dc:creator>Dov80</dc:creator>
      <dc:date>2018-06-28T19:32:14Z</dc:date>
    </item>
  </channel>
</rss>

