I've managed to get it to work with my main dynamic page. However, the issue I have is when it comes to the child pages.
The way I have my dynamic pages set us is, I have a category page, which links through to individual pages. The individual pages are generated for each row in the DB.
I have a "Presenters" column, which is a multi-selector. How do I only display the name value of a multi-selector from that individual row? Currently, this loops through all of the DB and outputs everything from the DB, rather than for that specific row.
{% for row in hubdb_table_rows(dynamic_page_hubdb_table_id, queryparam) %}
{% for category in row['presenters']%}<span class="presenter">{{ category.name }}</span>, {% endfor %}
{% endfor %}
Print HubDB Multi-select value on Dynamic pages (Child pages)
SOLVE
Hi,
Thanks for the reply. I already have the dynamic template set up. The specific problem I'm having is to display the name value of the multi-select column on the individual pages.
If I just use the below, as you suggest,:
{{ dynamic_page_hubdb_row.presenters }}
The out put is [{id=1, name='Steve', order=0}, {id=2, name='Emma', order=1}]
All I want to display is the name value. Adding .name displays nothing.
Print HubDB Multi-select value on Dynamic pages (Child pages)
SOLVE
Hi @Philip_Marsh, so you want to display a list of all the options that are in your mutli select? You want to use hubdb_table_columns and you have to add .options like so:
{% set presenters = hubdb_table_column(dynamic_page_hubdb_table_id, "presenters").options %}
{% for item in presenters %}
<span class="presenter">{{ presenters.name }}</span>,
{% endfor %}
Jun 25, 20214:51 AM - edited Jun 25, 20214:59 AM
Contributor
Print HubDB Multi-select value on Dynamic pages (Child pages)
SOLVE
So, I have a column called presenters with 5 options:
Steve
Emma
Mark
Craig
Robert
I have a dynamic page set up that turns each row into a page.
In row 1, I have Steve and Emma selected
In row 2, I have Mark and Steve selected
On page 1, I only want to show Steve and Emma, and on Page 2 I want to only show Mark and Steve.
My current code just looped through the entire database and would show as "Steve, Emma, Mark, Steve" regardless of what page you are on. It just loops through the entire database.
I've tried your suggested code but as you said, it only prints out the available options for the multiple selector, not what has been selected