日本語コミュニティーへようこそ!このチャンネルは現在ベータ版です。

詳細はこちらをご覧ください。

HubDB - Get and Output Column Name and Label

Highlighted
新規投稿者

I am trying to create a dynamic experience where the output is dependant solely on the table. Is there a way to check if a column is empty, and if not, output the column name and column label?

 

This is how I want the code to work:

<div id="filters" class="button-group">
    <button class="button is-checked" data-filter="*">All Channels</button>
    {% for row in hubdb_table_rows(673165) %}
    {# if column is not empty, add this line #}<button class="button" data-filter="{# add column name #}">{# add column lable #}</button>
    {% endfor %}
</div>

 

This is what I would like the output to be:

<div id="filters" class="button-group">  
    <button class="button is-checked" data-filter="*">All Channels</button>
    <button class="button" data-filter=".Basic">Basic TV</button>
    <button class="button" data-filter=".ExpandedBasic">Expanded Basic</button>
    <button class="button" data-filter=".DigitalCable">Digital Cable</button>
    <button class="button" data-filter=".DigitalFamilyTier">Digital Family</button>
    <button class="button" data-filter=".HDBasicCable">HD Basic Cable</button>
    <button class="button" data-filter=".HDPremiumMovie">HD Premium Movie</button>
    <button class="button" data-filter=".DigitalPPV">Digital PPV</button>
    <button class="button" data-filter=".DigitalMusic">Digital Music</button>
</div>

Any idea? And please note that I would like to achieve this without messing with API.

 

Thanks,

Vivian

返信
0 いいね!
2件の返信2
コミュニティーマネージャー

Hey @kuno-vivian are you still having trouble? If so please let me know and I'll get you connected with a design expert. 

返信
0 いいね!
新規投稿者

@roisinkirby, I had to manually input this since it was for a client and there was deadline involved. However, I would still like a solution for this if possible!

 

Thanks,

Vivian

返信
0 いいね!