CMS Development

josephLayden
投稿者

Filter HubDB by row using Hubl

解決

I am trying to create a listing page that provides a links by state.  The example below, would show all press releases from California tagged 'CA' in the row 'State'

 

{% set table = hubdb_table_rows(679969, queryparam) %}

{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}

{% if row["state"] in table == "CA" %}

<div class="container row-fluid">
  <div class="state-post-listing">
    <ul>	
      <li><a href="{{ row['embed'] }}">{{ row["date"]|datetimeformat('%A %e %B %Y') }}&nbsp;|&nbsp;{{ row['name'] }}&nbsp;|&nbsp;{{ row['state'] }}<a/></li>
    </ul>
  </div>
</div>

{% endif %}


{% endif %}


0 いいね!
1件の承認済みベストアンサー
josephLayden
解決策
投稿者

Filter HubDB by row using Hubl

解決

I did not have the correct logic.  I fixed the problem by adding 'state=CA' where state is the name/ID of the row and CA is the value i am sorting for.

 

{% set table = hubdb_table_rows(679969, 'state=CA') %}

{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}

{% for row in table %}

<div class="container row-fluid">
  <div class="state-post-listing">
    <ul>	
      <li><a href="{{ row['embed'] }}">{{ row['date'] }} | {{ row['name'] }} | {{ row['state'] }}<a/></li>
    </ul>
  </div>
</div>

{% endfor %}
{% endif %}

元の投稿で解決策を見る

0 いいね!
2件の返信
roisinkirby
HubSpot製品開発チーム
HubSpot製品開発チーム

Filter HubDB by row using Hubl

解決
0 いいね!
josephLayden
解決策
投稿者

Filter HubDB by row using Hubl

解決

I did not have the correct logic.  I fixed the problem by adding 'state=CA' where state is the name/ID of the row and CA is the value i am sorting for.

 

{% set table = hubdb_table_rows(679969, 'state=CA') %}

{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}

{% for row in table %}

<div class="container row-fluid">
  <div class="state-post-listing">
    <ul>	
      <li><a href="{{ row['embed'] }}">{{ row['date'] }} | {{ row['name'] }} | {{ row['state'] }}<a/></li>
    </ul>
  </div>
</div>

{% endfor %}
{% endif %}
0 いいね!