<?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: HUBL query for if in &amp;quot;edit mode&amp;quot; in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/788836#M34005</link>
    <description>&lt;P&gt;Hey all, wanted to let everyone know there's actually better HubL variables to test against now:&lt;BR /&gt;&lt;A href="https://developers.hubspot.com/changelog/march-2023-rollup#:~:text=are%20most%20needed.-,New%20HubL%20Variables,-for%20Detecting%20When" target="_blank"&gt;https://developers.hubspot.com/changelog/march-2023-rollup#:~:text=are%20most%20needed.-,New%20HubL%20Variables,-for%20Detecting%20When&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;These are a more reliable way of testing in HubL than using request.postDict.inpageEditorUI&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Additionally JavaScript and CSS can be used as well:&lt;BR /&gt;&lt;A href="https://developers.hubspot.com/docs/cms/guides/provide-a-good-editor-experience" target="_blank"&gt;https://developers.hubspot.com/docs/cms/guides/provide-a-good-editor-experience&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 13:54:27 GMT</pubDate>
    <dc:creator>jmclaren</dc:creator>
    <dc:date>2023-05-02T13:54:27Z</dc:date>
    <item>
      <title>HUBL query for if in "edit mode"</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/445590#M23560</link>
      <description>&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;I have a few sections that use conditional logic to display different modules on a page, however this creates some issue with the modules not being there when you edit the page. So i'm looking for a way using hubl logic to determine if the page is being edited then show all the modules. I noticed there are some css classes that are different in edit mode and I have in the past used a method where all motions are conditionally hidden with css and shown in the editor, but I would much prefer if I can just use hubl to remove them entirely to prevent bloat from additional unnecessary html. If anyone has any ideas let me know!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 17:26:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/445590#M23560</guid>
      <dc:creator>Manobyte</dc:creator>
      <dc:date>2021-06-09T17:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: HUBL query for if in "edit mode"</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/445968#M23571</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/18498"&gt;@Manobyte&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Use Boolean option. See SS:&amp;nbsp;&lt;A href="https://prnt.sc/1521i0l" target="_blank"&gt;https://prnt.sc/1521i0l&lt;/A&gt;&amp;nbsp;and on/off module with editor.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;If we were able to answer your query, kindly help the community by marking it as a solution.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 13:18:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/445968#M23571</guid>
      <dc:creator>webdew</dc:creator>
      <dc:date>2021-06-10T13:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: HUBL query for if in "edit mode"</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/446047#M23576</link>
      <description>&lt;P&gt;You can do this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% if request.postDict.inpageEditorUI %}
  {# will only display if page is being viewed in the editor #}
{% endif %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 14:50:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/446047#M23576</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2021-06-10T14:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: HUBL query for if in "edit mode"</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/446055#M23577</link>
      <description>&lt;P&gt;I am looking for more of a template solution rather then a custom module one. I know how to show/hide the content (Im dealing with global content that changes based on language), but if a module is hidden this way then it becomes un editable when editing the page, and only the options that meet the current requierment are available. It could potentualy all be moved into a single custom module but then you lose the other templeting benifits of having individule modules for the content.&lt;BR /&gt;&lt;BR /&gt;I was thinging that maybe using&amp;nbsp;&lt;SPAN&gt;export_to_template_context might be an option, this would atleast make the modules available in the side bar, but you would lose the ability to just "click" to edit the module, and you would not be able to visually see the updates untill published.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 15:06:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/446055#M23577</guid>
      <dc:creator>Manobyte</dc:creator>
      <dc:date>2021-06-10T15:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: HUBL query for if in "edit mode"</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/703186#M30777</link>
      <description>&lt;P&gt;I had a hard time using this snippet. It showed the content in the preview, but I could not access the modules to edit them.&lt;/P&gt;&lt;P&gt;So what I did, I tried to find a similar variable in the dev info. I found a more simple/native one there (maybe HubSpot added it later). So here is my solution, in case someone got the same issue: Simply change the&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if request.postDict.inpageEditorUI %}&lt;/LI-CODE&gt;&lt;P&gt;... to ...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if is_in_editor %}&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 07:34:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/703186#M30777</guid>
      <dc:creator>FabianRichter</dc:creator>
      <dc:date>2022-10-07T07:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: HUBL query for if in "edit mode"</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/743446#M32372</link>
      <description>&lt;P&gt;Awesome! I've been looking for the same thing - thank you Fabian.&lt;/P&gt;&lt;P&gt;It appears the 'request.postDict.inpageEditorUI' value is set after the editor has determined editable areas and modules in the template file, but the 'is_in_editor' property is set earlier. So something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if dynamic_page_route_level == 1 or request.postDict.inpageEditorUI %}
  {% dnd_area "area_1" %}
  {% end_dnd_area %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;will fail to display the DND area editable, but&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if dynamic_page_route_level == 1 or is_in_editor %}
  {% dnd_area "area_1" %}
  {% end_dnd_area %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;will allow the area to correctly display editable.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 17:18:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/743446#M32372</guid>
      <dc:creator>S2-StvSimons</dc:creator>
      <dc:date>2023-01-18T17:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: HUBL query for if in "edit mode"</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/788836#M34005</link>
      <description>&lt;P&gt;Hey all, wanted to let everyone know there's actually better HubL variables to test against now:&lt;BR /&gt;&lt;A href="https://developers.hubspot.com/changelog/march-2023-rollup#:~:text=are%20most%20needed.-,New%20HubL%20Variables,-for%20Detecting%20When" target="_blank"&gt;https://developers.hubspot.com/changelog/march-2023-rollup#:~:text=are%20most%20needed.-,New%20HubL%20Variables,-for%20Detecting%20When&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;These are a more reliable way of testing in HubL than using request.postDict.inpageEditorUI&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Additionally JavaScript and CSS can be used as well:&lt;BR /&gt;&lt;A href="https://developers.hubspot.com/docs/cms/guides/provide-a-good-editor-experience" target="_blank"&gt;https://developers.hubspot.com/docs/cms/guides/provide-a-good-editor-experience&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:54:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HUBL-query-for-if-in-quot-edit-mode-quot/m-p/788836#M34005</guid>
      <dc:creator>jmclaren</dc:creator>
      <dc:date>2023-05-02T13:54:27Z</dc:date>
    </item>
  </channel>
</rss>

