<?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 filter to show future hubdb events used in rich text editor in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000920#M39753</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/122099"&gt;@cives&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will work in the rich text module. As you can see I have created a dummy &lt;A href="https://prnt.sc/FyNDo_DttNh6" target="_blank" rel="noopener"&gt;Hubdb table&lt;/A&gt; and fetched the data from a &lt;A href="https://prnt.sc/BR94BgpdI1oX" target="_blank" rel="noopener"&gt;rich text module&lt;/A&gt; ( &lt;A href="https://prnt.sc/5Vq0aUxIA8JS" target="_blank" rel="noopener"&gt;source code&lt;/A&gt; )and it only displayed the &lt;A href="https://prnt.sc/dg_xHEyafXTc" target="_blank" rel="noopener"&gt;upcoming events&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-sheets-root="1" data-sheets-value="{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:&amp;quot;I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.\nThanks!&amp;quot;}" data-sheets-userformat="{&amp;quot;2&amp;quot;:769,&amp;quot;3&amp;quot;:{&amp;quot;1&amp;quot;:0},&amp;quot;11&amp;quot;:4,&amp;quot;12&amp;quot;:0}"&gt;I hope this will help you out. Please mark it as &lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt; to help another Community member.&lt;BR /&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 08:39:06 GMT</pubDate>
    <dc:creator>GRajput</dc:creator>
    <dc:date>2024-07-04T08:39:06Z</dc:date>
    <item>
      <title>Hubl filter to show future hubdb events used in rich text editor</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000212#M39731</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using some hubl in a rich text editor within global content of my website and am trying to use a filter to show the date next to an event in a mega menu, only if it is in the future.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My current code is:&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;&amp;lt;h6 style="margin-bottom: 8px; font-size: 14px;"&amp;gt;MAJOR EVENTS&amp;lt;/h6&amp;gt;
{% for row in hubdb_table_rows('14621261', "&amp;amp;amp;orderBy=start_date&amp;amp;amp;type=Major Event") %}
&amp;lt;ul style="list-style-type: none; margin: 0; padding: 0;"&amp;gt;
&amp;lt;li style="padding-bottom: 3px;"&amp;gt;&amp;lt;a style="color: #171b25; margin: 0 15px; font-weight: 500; font-size: var(--fs-amm-menu-sub);" href="{{ row.event_url }}"&amp;gt; {{ row.name }} &amp;lt;strong&amp;gt;{{ row.start_date|datetimeformat('%b %d, %Y') }}&amp;lt;/strong&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
{% endfor %}&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;I've tried&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 row.start_date__gt=-86400s %} &amp;lt;strong&amp;gt;{{ row.start_date|datetimeformat('%b %d, %Y') }}&amp;lt;/strong&amp;gt;{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&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 row.start_date__gte=unixtimestamp(local_dt) %} &amp;lt;strong&amp;gt;{{ row.start_date|datetimeformat('%b %d, %Y') }}&amp;lt;/strong&amp;gt;{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing seems to be working. Any guidance is appreciated. Thanks&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 2024-07-02 at 3.08.00 PM.png" style="width: 569px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120974iA6BCCBCF39EFB676/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-07-02 at 3.08.00 PM.png" alt="Screenshot 2024-07-02 at 3.08.00 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-02 at 3.07.44 PM.png" style="width: 611px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120973i4418D341FFBD0EF8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-07-02 at 3.07.44 PM.png" alt="Screenshot 2024-07-02 at 3.07.44 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 19:15:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000212#M39731</guid>
      <dc:creator>cives</dc:creator>
      <dc:date>2024-07-02T19:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl filter to show future hubdb events used in rich text editor</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000613#M39741</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/122099"&gt;@cives&lt;/a&gt;&amp;nbsp;- I don't know if this will apply, but I presonally use the HubL filter 'between_times) to compare dates in a context like this.&lt;/P&gt;
&lt;P&gt;As in:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{% set days_left = to_local_time(unixtimestamp()) | between_times( module.webinar_start , 'days') %}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Obviously you can deal with positive and negative values for your purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 14:09:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000613#M39741</guid>
      <dc:creator>SteveHTM</dc:creator>
      <dc:date>2024-07-03T14:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl filter to show future hubdb events used in rich text editor</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000619#M39742</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/122099"&gt;@cives&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to convert your date in UNIX format and then compare that with the current date using a condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;h6 style="margin-bottom: 8px; font-size: 14px;"&amp;gt;MAJOR EVENTS&amp;lt;/h6&amp;gt;
&amp;lt;div style="color: #000;"&amp;gt;

{% set queryparam = "&amp;amp;amp;orderBy=event_date" %} {% set queryparam = queryparam + "&amp;amp;amp;start_date__gt=" + local_dt|unixtimestamp %}
 {% set table = hubdb_table_rows('YOUR HUBDB TABLE ID', queryparam) %} 
{% if table = [] %}
&amp;lt;p class="lead"&amp;gt;Sorry, no webinars available.&amp;lt;/p&amp;gt;
{% else %}
&amp;lt;ul&amp;gt;{% for row in table %}
&amp;lt;li&amp;gt;{{ row.event_name }} &amp;lt;strong&amp;gt;{{ row.event_date|format_date('dd/MMMM,yyy') }}&amp;lt;/strong&amp;gt;&amp;lt;/li&amp;gt;
{% endif %} {% endfor %}&amp;lt;/ul&amp;gt;
{% endif %}&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"I hope this will help you out. Please mark it as &lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt; to help another Community member.&lt;BR /&gt;Thanks!"&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 14:17:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000619#M39742</guid>
      <dc:creator>GRajput</dc:creator>
      <dc:date>2024-07-03T14:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl filter to show future hubdb events used in rich text editor</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000672#M39743</link>
      <description>&lt;P&gt;Thank you both for the response. The issue is that I am building this in a rich text module in my website's theme global content editor. I'm doing this to reference dynamic content in a dropdown menu.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;h6 style="margin-bottom: 8px; font-size: 14px;"&amp;gt;MAJOR EVENTS&amp;lt;/h6&amp;gt;
{% set td = unixtimestamp(today("America/New_York").plusDays(0)) %} {{ td||pprint }} {% for row in hubdb_table_rows('14621261', "&amp;amp;amp;orderBy=start_date&amp;amp;amp;type=Major Event") %}
&amp;lt;ul style="list-style-type: none; margin: 0; padding: 0;"&amp;gt;
&amp;lt;li style="padding-bottom: 3px;"&amp;gt;&amp;lt;a style="color: #171b25; margin: 0 15px; font-weight: 500; font-size: var(--fs-amm-menu-sub);" href="{{ row.event_url }}"&amp;gt; {{ row.name }}{{ unixtimestamp(row.start_date) }} {{ td }} {% if unixtimestamp(row.start_date)__gte="td" %}&amp;lt;strong&amp;gt;{{ row.start_date|datetimeformat('%b %d, %Y') }}&amp;lt;/strong&amp;gt;{% endif %}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
{% endfor %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is the comparison portion of the if statement, it appears the rich text editor does not like __gte""&lt;/P&gt;&lt;P&gt;gte or &amp;gt;=, the latter of which is escaped to &amp;amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if unixtimestamp(row.start_date) &amp;gt;= td %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to use &lt;A href="https://developers.hubspot.com/docs/cms/hubl/operators-and-expression-tests" target="_blank" rel="noopener"&gt;operators/expressions&lt;/A&gt; in the rich text environment?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 15:50:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000672#M39743</guid>
      <dc:creator>cives</dc:creator>
      <dc:date>2024-07-03T15:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Hubl filter to show future hubdb events used in rich text editor</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000920#M39753</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/122099"&gt;@cives&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will work in the rich text module. As you can see I have created a dummy &lt;A href="https://prnt.sc/FyNDo_DttNh6" target="_blank" rel="noopener"&gt;Hubdb table&lt;/A&gt; and fetched the data from a &lt;A href="https://prnt.sc/BR94BgpdI1oX" target="_blank" rel="noopener"&gt;rich text module&lt;/A&gt; ( &lt;A href="https://prnt.sc/5Vq0aUxIA8JS" target="_blank" rel="noopener"&gt;source code&lt;/A&gt; )and it only displayed the &lt;A href="https://prnt.sc/dg_xHEyafXTc" target="_blank" rel="noopener"&gt;upcoming events&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-sheets-root="1" data-sheets-value="{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:&amp;quot;I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.\nThanks!&amp;quot;}" data-sheets-userformat="{&amp;quot;2&amp;quot;:769,&amp;quot;3&amp;quot;:{&amp;quot;1&amp;quot;:0},&amp;quot;11&amp;quot;:4,&amp;quot;12&amp;quot;:0}"&gt;I hope this will help you out. Please mark it as &lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt; to help another Community member.&lt;BR /&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 08:39:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Hubl-filter-to-show-future-hubdb-events-used-in-rich-text-editor/m-p/1000920#M39753</guid>
      <dc:creator>GRajput</dc:creator>
      <dc:date>2024-07-04T08:39:06Z</dc:date>
    </item>
  </channel>
</rss>

