Options
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable
HubDB - Get and Output Column Name and Label
Highlighted
Nouveau contributeur
09-01-2017 02:10 - modifié 09-05-2017 09:42
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
Options
- Marquer comme nouveau
- Marquer
- S'abonner
- S'abonner au fil RSS
- Surligner
- Imprimer
- Envoyer à un ami
- Signaler un contenu inapproprié