CMS Development

imerial
参加者

Query Syntax HUBDB

解決

Hi Community,

 

I'm trying to filter a table I have using contain.  The AssetClass column is TEXT. I want to display only rows that have the word Future-Index and Commodity. example1.png

I wrote the following but It doesn't work. I don't know how to use two different parameters for contains.  Can anyone help me figure out? Thank you

 

{% set table = hubdb_table_rows(2595031,'assetclass__contains=Future-index,Commodity') %}

{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}
<div class="card tblHolding" id="Holding">
<div class="card-body">
<!-- <h1>{{ module.heading }}<span>{{ module.sub_heading }}</span></h1> -->
<div class="card-text">
<div>
<div class="row">
<div class="custom-column">
<table class="table table-striped">
<thead>
<tr>
<th><span>Stockticker </span></th>
<th><span>Security Name</span></th>
<th><span>Shares </span></th>
<th><span>Price </span></th>
<th><span>Market Value</span></th>
<th><span>Weightings</span></th>
<th><span>Asset Class</span></th>

</tr>
</thead>
<tbody>

{% for item in table %}
<tr>
<td>{{ item.stockticker }}</td>
<td>{{ item.securityname }}</td>
<td>{{ item.shares }}</td>
<td>{{ item.price }}</td>
<td>{{ item.marketvalue }}</td>
<td>{{ item.weightings }}</td>
<td>{{ item.assetclass }}</td>
</tr>
{% endfor %}
</tbody>
</table> 
</div>
</div>
<div class="row bottom">
<div class="bottom-content"><h5>{{ module.bottom_text }}</h5></div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
0 いいね!
1件の承認済みベストアンサー
alyssamwilie
解決策
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

Query Syntax HUBDB

解決

Hey @imerial ,

 

As far as I know you can't use multiple parameters with contain. You could either create two separate table listings for each assetclass you want to list OR switch these columns to a SELECT option and use the in filter name.

 

{% set table = hubdb_table_rows(2595031,'assetclass__in=Future - Index,Commodity') %}

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

元の投稿で解決策を見る

1件の返信
alyssamwilie
解決策
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

Query Syntax HUBDB

解決

Hey @imerial ,

 

As far as I know you can't use multiple parameters with contain. You could either create two separate table listings for each assetclass you want to list OR switch these columns to a SELECT option and use the in filter name.

 

{% set table = hubdb_table_rows(2595031,'assetclass__in=Future - Index,Commodity') %}

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.