Wussten Sie, dass wir eine deutschsprachige Community haben?

HubDB - Get and Output Column Name and Label

Highlighted
Mitwirkender

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

Antworten
0 Like / Likes
2 ANTWORTEN 2
Community-Manager

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

Antworten
0 Like / Likes
Mitwirkender

@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

Antworten
0 Like / Likes