CMS Development

LMcColl
Member

Hubdb tables

SOLVE

I'm having major trouble with our the display order in our HubDB tables. We are using tables to display videos on our site, and are in the process of trying to add new ones. However, whenever we add a new video to the tables, it is shown at the END of the loop, rather than the beginning. How can we edit the display order? 

 

We added a column to the tables so that we could add the order we'd like them displayed. However, I cannot figure out where/how to edit the HUBl or HTML to get the display order to work. 

 

I have searched the forums for help, and see reference to downloading the current table content to a CSV, re-ordering it and then uploading again from the CSV. But honestly, I don't know how to do that! (I'm new to the Hubspot CMS)

 

At this point, I'm about to delete all our videos just so that I can re-upload them into the correct order, but wanted to try reaching out for some "hail mary" advice first.

0 Upvotes
1 Accepted solution
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Hubdb tables

SOLVE

@LMcColl you should be able to use the `|sort` HubL filter on your HubDB table rows like so:

{% for row in hubdb_table_rows(123456)|sort(false, false, "column_name_to_sort_by") %}
{% endfor%}

You could also use a query filter directly:

{% for row in hubdb_table_rows(123456, "&orderBy=column_name")%}
{% endfor %}

 

Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

1 Reply 1
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Hubdb tables

SOLVE

@LMcColl you should be able to use the `|sort` HubL filter on your HubDB table rows like so:

{% for row in hubdb_table_rows(123456)|sort(false, false, "column_name_to_sort_by") %}
{% endfor%}

You could also use a query filter directly:

{% for row in hubdb_table_rows(123456, "&orderBy=column_name")%}
{% endfor %}

 

Stefen Phelps, Community Champion, Kelp Web Developer