<?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 A way to dynamically hide dnd_sections on certain Dynamic pages in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970666#M38878</link>
    <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;I'm currently facing this issue where I'm unable to hide certain dnd_sections based on whether I'm on overview page or detail page when rendering dynamic pages via HubDB.&lt;BR /&gt;&lt;BR /&gt;So for example on one page where you can see all the clickable links to go to essentially a HubDB row page when clicked, I need to hide certain sections because those are only displayed on the detail page for that certain HubDB row and it's data. Is there an easy way to do this? CSS display:none doesn't work I believe because you wrap a dnd_section in a div with a class, at least I didn't get that to work.&lt;BR /&gt;&lt;BR /&gt;Any help would be much appreciated! I'm kinda lost, and have tried a lot.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2024 20:27:23 GMT</pubDate>
    <dc:creator>Levi_STA</dc:creator>
    <dc:date>2024-05-02T20:27:23Z</dc:date>
    <item>
      <title>A way to dynamically hide dnd_sections on certain Dynamic pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970666#M38878</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;I'm currently facing this issue where I'm unable to hide certain dnd_sections based on whether I'm on overview page or detail page when rendering dynamic pages via HubDB.&lt;BR /&gt;&lt;BR /&gt;So for example on one page where you can see all the clickable links to go to essentially a HubDB row page when clicked, I need to hide certain sections because those are only displayed on the detail page for that certain HubDB row and it's data. Is there an easy way to do this? CSS display:none doesn't work I believe because you wrap a dnd_section in a div with a class, at least I didn't get that to work.&lt;BR /&gt;&lt;BR /&gt;Any help would be much appreciated! I'm kinda lost, and have tried a lot.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 20:27:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970666#M38878</guid>
      <dc:creator>Levi_STA</dc:creator>
      <dc:date>2024-05-02T20:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: A way to dynamically hide dnd_sections on certain Dynamic pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970863#M38879</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/717826"&gt;@Levi_STA&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you could&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- add a boolean(checkbox) like "Show section X" as a column to your table and wrap the corresponding section in an if statement like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set table_info = hubdb_table_rows( "Your-HubDB-ID" ) %} 

{% for row in table_info %}
{% if row.show_section_x %}
...
Your layout
...
{% endif %}
{% endfor %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- you could "automate it" by showing your layout based on an input from a different column. So if you'd like to show a specific section if the content(text) of a different column is "Cars" you could do it like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set table_info = hubdb_table_rows( "Your-HubDB-ID" ) %} 

{% for row in table_info %}
{% if row.headline == "Cars" %}
...
Your layout if the headline is cars
...
{% elif row.headline == "Bikes" %}
...
Your layout if the headline is bikes
...
{% elif row.headline == "" %}
...
Your layout if the headline is empty
...
{% else %}
...
Fallback for everything else
...
{% endif %}
{% endfor %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;p.s: Those&amp;nbsp; techniques require a custom pagetemplate with all of your HubDB settings/layout/functions and the parent &amp;amp; child page layouts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 08:40:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970863#M38879</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2024-05-03T08:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: A way to dynamically hide dnd_sections on certain Dynamic pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970906#M38880</link>
      <description>&lt;P&gt;But the problem with that is we can't have logic inside a dnd_area. So to show a section we would have to put that if in a dnd_area which doesn't work. And we can't have multiple sections based on an if, as that also didn't give results.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 09:59:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970906#M38880</guid>
      <dc:creator>Levi_STA</dc:creator>
      <dc:date>2024-05-03T09:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: A way to dynamically hide dnd_sections on certain Dynamic pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970925#M38881</link>
      <description>&lt;P&gt;That's correct but you can wrap the whole dnd_area inside the if-statement like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set table_info = hubdb_table_rows( module.hubdbtable_field ) %} 

   {% block body %}
        {% for row in table_info %}
            {% if row.show_section %}
                {% dnd_area 'section a' %}
                    &amp;lt;h1&amp;gt;
	                    {{ row.headline }}
                    &amp;lt;/h1&amp;gt;
                {% end_dnd_area %}
            {% else %}
                {% include_dnd_partial path='path/to/saved/section' %}
            {% endif %}
        {% endfor %}


    {% dnd_area 'something else' %}
    {% end_dnd_area %}
    {% endblock body %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 10:55:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970925#M38881</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2024-05-03T10:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: A way to dynamically hide dnd_sections on certain Dynamic pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970961#M38883</link>
      <description>&lt;P&gt;I understand, but that dnd_area is in a dnd_section. So we can't have logic in there either. And you can't have 2 dnd_sections, at least not from what I've seen.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 12:43:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/970961#M38883</guid>
      <dc:creator>Levi_STA</dc:creator>
      <dc:date>2024-05-03T12:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: A way to dynamically hide dnd_sections on certain Dynamic pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/971930#M38921</link>
      <description>&lt;P&gt;Managed to fix it by just removing all the dnd stuff and adding all into different divs and inserting the logic there.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 13:29:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/A-way-to-dynamically-hide-dnd-sections-on-certain-Dynamic-pages/m-p/971930#M38921</guid>
      <dc:creator>Levi_STA</dc:creator>
      <dc:date>2024-05-06T13:29:12Z</dc:date>
    </item>
  </channel>
</rss>

