CMS Development

marenhogan
Contributor | Elite Partner
Contributor | Elite Partner

Module pulls from HubDB in module preview, but not on page itself

SOLVE

Hello!

I am writing a simple custom module that pulls from a HubDB table. When I preview the module in the Design Manager, it pulls the data from the table as expected. 

 

However, when I add the module to a page, it doesn't pull anything at all. I have been going back and forth with Hubspot support, but they haven't been able to provide any help or seem to understand what I'm asking and keep referring me to a their Technical Consultation services. 

 

What could be causing this to work in the module previewer, but not when added to a page? 

 

I've attached screenshots of the module previewing showing the data from HubDB (Industries, types, default name, lorem ipsum, etcl). And the screenshot of the page itself where it isn't pulling in any of that data. 

 

Code below as well: 

{% set cardImageMax = 600 %}

{% for row in hubdb_table_rows('resources') %}
<li>{{ row.name }} - {{ row.description }}</li>
{% endfor %}
<p>
hi
</p>
<section class="u3m-filtered-content" style="{% if module.module_overrides and (module.top_margin or module.top_margin == 0 ) %}margin-top:{{ module.top_margin }}px; {% endif %} {% if module.module_overrides and (module.bottom_margin or module.bottom_margin == 0 ) %}margin-bottom:{{ module.bottom_margin }}px; {% endif %} ">

<a class="anchor" id="{% if module.module_overrides and module.section_id %}{{ module.section_id }}{% else %}section-{% for item in content.widget_containers.module_1550084949043111.widgets %}{% if content.widget_containers.module_1550084949043111.widgets[loop.index0].id == name|replace('widget_', '') %}{{loop.index}}{% endif %}{% endfor %}{% endif %}"></a>

<!-- Featured Source -->


{% if module.include_filters %}
<form class="u3m-filtered-content__multi-filter mixitup-multifilter">

<span class="wrapper">
<fieldset class="u3m-filtered-content__multi-filter__search fs_search" data-filter-group>
<input type="text" data-search-attribute="class" placeholder="Search by keyword" />
</fieldset>

{% set tab = hubdb_table_column(6126247, "topics") %}
{% if tab %}
<fieldset class="u3m-filtered-content__multi-filter__select fs_industries_new" data-filter-group>
<select>
<option value="">All industries</option>
{% for cat in tab.options %}
<option value=".{{ cat.name|lower|replace(' ','-')|replace('/','-')|replace('&','-')|replace(',','-') }}">{{ cat.name }}</option>
{% endfor %}
</select>
</fieldset>
{% endif %}

{% set tab2 = hubdb_table_column(6126247, "type") %}
{% if tab2 %}
<fieldset class="u3m-filtered-content__multi-filter__select fs_industries_type" data-filter-group>
<select style="display:none;">
{# for cat2 in tab2.options %}
<option value=".{{ cat2.name|lower|replace(' ','-')|replace('/','-')|replace('&','-')|replace(',','-') }}">{{ cat2.name }}</option>
{% endfor #}
<option value="">All Types</option>
{% for cat in tab2.options %}
<option value=".{{ cat.name|lower|replace(' ','-')|replace('/','-')|replace('&','-')|replace(',','-') }}">{{ cat.name }}</option>
{% endfor %}
</select>
<select>
<option value="">All Types</option>
{% for cat2 in tab2.options %}
<option value=".{{ cat2.name|lower|replace(' ','-')|replace('/','-')|replace('&','-')|replace(',','-') }}">{{ cat2.name }}</option>
{% endfor %}
</select>
</fieldset>
{% endif %}
</span>
</form>
{% endif %}
<div class="container-wrapper">
<!-- Set HubDB Data Source -->
{% set table = hubdb_table_rows(6126247 , "&orderBy=-order") %}

<div class="u3m-filtered-content__container">
<div class="live-area container">
{% for row in table %}
{% if true %}

<div class="invisible name" style="display:none;">
{% set ind_tag = row.type.name|striptags|lower|replace(' ', '-') %}
</div>

<div ind_tag="{{ ind_tag }}" class="u3m-filtered-content__container__resource-card mix {{ row.name|striptags|lower|replace(' ', '-') }} {{ row.type.name|striptags|lower|replace(' ', '-') }} {% for category in row.topics %} {{ category.name|striptags|lower|replace(' ','-')|replace('/','-')|replace('&','-')|replace(',','-') }} {% endfor %}">
<a class="link-wrap" href="{{ row.link }}">
{#<div class="image" style="background-image: url('{{ resize_image_url(row.image.url, 0,0,cardImageMax) }}');"></div>#}
<div class="content">
<div class="upper">
<div class="thumbnail" style="background-image: url('{{ row.image.url }}')">

</div>
<div class="content-wrap">
<span class="medium {{ row.type.name|lower }}">{{ row.type.name }}</span>
{% if mod1 %}
<h2 class="heading">{{ row.name }}</h2>
{% else %}
<h3 class="heading">{{ row.name }}</h3>
{% endif %}
<div class="description">{{ row.description|striptags|truncate(105) }}</div>

<div class="learn-more">

<span class="learn-more {{ row.type.name|lower }}">Read More</span>

{# if row.type.name == "Video" %} <span class="learn-more {{ row.type.name|lower }}">Watch Video</span> {% endif %}
{% if row.type.name == "Case Study" %} <span class="learn-more {{ row.type.name|lower }}">Read Case Study</span> {% endif %}
{% if row.type.name == "Infographic" %} <span class="learn-more {{ row.type.name|lower }}">Download Infographic</span> {% endif %}
{% if row.type.name == "Webinar" %} <span class="learn-more {{ row.type.name|lower }}">Watch Webinar</span> {% endif %}
{% if row.type.name == "Whitepaper" %} <span class="learn-more {{ row.type.name|lower }}">Download Whitepaper</span> {% endif %}
{% if row.type.name == "Overview" %} <span class="learn-more {{ row.type.name|lower }}">Learn More</span> {% endif #}

</div>
</div>
</div>
</div>
</a>
</div>
{% endif %}
{% endfor %}
<div class="no-result-found" style="display: none;">
<div class="no-result-icon"><i class="fas fa-search"></i></div>
<h4>
No results found
</h4>
<div class="no-result-text">No results match the filter criteria. Remove filter or clear all filters to show results.</div>
<a href="javascript&colon;void(0)" class="clear_filter">Clear all filters</a>
</div>
</div>
</div>
</div>

<!-- <div class="u3m-filtered-content__pagination mixitup-page-list"></div> -->
<div class="u3m-filtered-content__load_more mix-load-more-container"><button class="mix-load-more">Load More</button></div>
</div>
</section>
1 Accepted solution
marenhogan
Solution
Contributor | Elite Partner
Contributor | Elite Partner

Module pulls from HubDB in module preview, but not on page itself

SOLVE

Yes and no 🙂 It turns out, the client has HubDB through their subscription, but because they don't have Pro or Enterprise CMS, it won't actually work on a page, even though it works in the module previewer.

 

The support person was also frustrated after all of the back and forth trying to figure out why it was working on the back-end, but not on the front-end, and said they would submit feedback to the team about having some kind of banner or notice that the account needs an upgrade rather than simply not working. 

View solution in original post

2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Module pulls from HubDB in module preview, but not on page itself

SOLVE

Hey, @marenhogan 👋 Quick follow up. Were you able to make any progress here? If not, we can try tagging a few of our HubDB-minded community members and invite them to the conversation.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

marenhogan
Solution
Contributor | Elite Partner
Contributor | Elite Partner

Module pulls from HubDB in module preview, but not on page itself

SOLVE

Yes and no 🙂 It turns out, the client has HubDB through their subscription, but because they don't have Pro or Enterprise CMS, it won't actually work on a page, even though it works in the module previewer.

 

The support person was also frustrated after all of the back and forth trying to figure out why it was working on the back-end, but not on the front-end, and said they would submit feedback to the team about having some kind of banner or notice that the account needs an upgrade rather than simply not working.