<?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 Preview page layout guides in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Preview-page-layout-guides/m-p/446248#M23583</link>
    <description>&lt;P&gt;In an effort to provide a way to help my teams content editors create consistent layouts with DnD modules and pages, taking some inspiration from &lt;A href="https://codyhouse.co/ds/components/app/grid-background" target="_blank" rel="noopener"&gt;CodyHouse&lt;/A&gt; I have been able to overlay a guide:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-06-10 at 23.44.51.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/44216iD5A5FF3C557831F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-06-10 at 23.44.51.png" alt="Screenshot 2021-06-10 at 23.44.51.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The site is not live, but when it is I would like to enable a feature to toggle on or off the grid overlay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Typically in a cms, I would utilise some form of user_logged_in value to detect. As I see from aonther thread HubSpot does not support this standard feature.&lt;BR /&gt;&lt;BR /&gt;I am keen to know are there any possible hooks that would allow me to only inject the grid when a editor is viewing the page in the editor and or the preview.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have been using javascript to detect a Hubspot specific UI component such as the toolbar. But I would like a solution that is less hacky.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;TBH - I think this could be a useful Hubspot feature in general &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 22:53:25 GMT</pubDate>
    <dc:creator>NPeters</dc:creator>
    <dc:date>2021-06-10T22:53:25Z</dc:date>
    <item>
      <title>Preview page layout guides</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Preview-page-layout-guides/m-p/446248#M23583</link>
      <description>&lt;P&gt;In an effort to provide a way to help my teams content editors create consistent layouts with DnD modules and pages, taking some inspiration from &lt;A href="https://codyhouse.co/ds/components/app/grid-background" target="_blank" rel="noopener"&gt;CodyHouse&lt;/A&gt; I have been able to overlay a guide:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-06-10 at 23.44.51.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/44216iD5A5FF3C557831F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-06-10 at 23.44.51.png" alt="Screenshot 2021-06-10 at 23.44.51.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The site is not live, but when it is I would like to enable a feature to toggle on or off the grid overlay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Typically in a cms, I would utilise some form of user_logged_in value to detect. As I see from aonther thread HubSpot does not support this standard feature.&lt;BR /&gt;&lt;BR /&gt;I am keen to know are there any possible hooks that would allow me to only inject the grid when a editor is viewing the page in the editor and or the preview.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have been using javascript to detect a Hubspot specific UI component such as the toolbar. But I would like a solution that is less hacky.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;TBH - I think this could be a useful Hubspot feature in general &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 22:53:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Preview-page-layout-guides/m-p/446248#M23583</guid>
      <dc:creator>NPeters</dc:creator>
      <dc:date>2021-06-10T22:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Preview page layout guides</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Preview-page-layout-guides/m-p/446409#M23588</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sadly, there is not really a nice way to check if you are logged into to the site as a HubSpot user. They way we do this, is with a quick jQuery script in case of need (fairly easy to rewrite to Vanilla JS):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;lookupInterval = setInterval(function() {
    if ($('.hs-tools-menu').length &amp;gt; 0) {
      // Form is rendered, stop looking
      clearInterval(lookupInterval);
      hsLoggedIn();
    }
  }, 100);
  function hsLoggedIn() {
    $('body').addClass('hs-logged-in');
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An other easier JS option would be this script, that checks if your in the HubSpot Editor:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if (window.hsInEditor) {
// something something
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option is doing some tricky stuff with the Visitor api:&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/conversation/visitor-identification," target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/api/conversation/visitor-identification&lt;/A&gt;&amp;nbsp;by identifieing who's talking. Yet, this might be solid in the future, for now it will give you hard time to set up.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For now, I suggest creating a simple modules that enables / disables the grid and place it on the top of the page. If you set it "on", it shows a grid that overlaps on the whole page / DND editor.&lt;BR /&gt;&lt;BR /&gt;The best would be, indeed, a simple function that would let you check if your logged in or not! a simple i&lt;EM&gt;s_user &lt;/EM&gt; or&amp;nbsp;&lt;EM&gt;is_admin&lt;/EM&gt;&amp;nbsp;variable would be sufficient.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 12:37:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Preview-page-layout-guides/m-p/446409#M23588</guid>
      <dc:creator>Sjardo</dc:creator>
      <dc:date>2021-06-11T12:37:59Z</dc:date>
    </item>
  </channel>
</rss>

