CMS Development

mgoswick
Contributeur

Printing Values from HubDB "select" column

Résolue

I'm sure there's a simple way to do this but I can't figure it out. I have a HubDB table with several entries that are categorized by a select list. Getting the filtering and such has not been a problem, but when I add {{ row["name_of_select_list"]}} inside of a <p></p>, rather than just printing the value like text and rich text columns do, it prints {id=#, name='Value from Select List'}. How do I get just the name value to print?
I tried:
{{ row["name_of_select_list"]}}.value,
{{ row["name_of_select_list"]}}.name, 
{{ row["name_of_select_list"].name}}, 
{{ name.row["name_of_select_list"]}},
etc.
and have not had any luck

0 Votes
1 Solution acceptée
Jsum
Solution
Conseiller clé

Printing Values from HubDB "select" column

Résolue

@mgoswick,

 

in this tutorial They are using a select field for "type". When they call the value in the code  example they do so like this:

{{ row["type"].name }}

I see that you have already tried this but considering the syntax in the tutorial is correct (or at least assuming so) you may want to double check your code and try  it again. 

 

If it still doesn't work, would you share your code?

Voir la solution dans l'envoi d'origine

2 Réponses
Jsum
Solution
Conseiller clé

Printing Values from HubDB "select" column

Résolue

@mgoswick,

 

in this tutorial They are using a select field for "type". When they call the value in the code  example they do so like this:

{{ row["type"].name }}

I see that you have already tried this but considering the syntax in the tutorial is correct (or at least assuming so) you may want to double check your code and try  it again. 

 

If it still doesn't work, would you share your code?

mgoswick
Contributeur

Printing Values from HubDB "select" column

Résolue

Not sure why it didn't work before, but {{ row["type"].name}} worked as it should. Thanks.

0 Votes