Im new to Hubspot CMS and I'm wondering how to display data from a single row in HubDB.
This is my table:
I would like to make an event page with only the data from the first row (and an other event page with just the data of the second row).
I managed to create a listing page with both rows (and path's) - but I want to show a detailpage when I click the path (with just the data from the row I clicked on).
You can follow this snippet {% set row = hubdb_table_row(<tableId or name>, <rowId>) %} the value for {{ row.hs_id }} is {{ row.<column name> }}
i have try with my hubdb it is showing single row content only {% set row = hubdb_table_row(5325434, 624257568157) %} the value for {{ row.hs_id }} is {{ row.pricing }}
Hope this helps! If we were able to answer your query, kindly help the community by marking it as a solution. Thanks and Regards.
@JDam, as @dennisedson is telling I would like to ask you to share your code and a screenshot of your page settings.
With the use of dynamic pages, some steps are very important for you to setup like:
Setup HubDB on page level underneath the page settings
Is your page published, otherwise it won't work
I think there are three options which you can choose from:
Option 1: Dynamic pages
Dynamic pages are in your case the best way since you only have to build one module to display all data.
If you want to setup pages manually, there is another option you can do.
Pros: Your customer can manage all from one HubDB without creating a single page since this need to be setup when setting up the dynamic pages.
Cons: All information has to be storred into the HubDB, you can't just add extra information that can be managed on the event page. You can only add global content but will all be the same for all event pages
Option 2: HubDB Row field
Create a custom module. In there you can use the HubDB Row field. This field let you select a certain row of a database. Checkout the product update for more explanation.
Pros: You can use it as a custom module on every page, so this doesn't have to be a event page. Also it's possible to add extra content to the event page since this is a 'normal' website page.
Cons: The customer manually needs to create a event page. This is more work. Also you will need to create 2 modules. One for the listing/overview, one for the event page.
Option 3: Use the blog functionality
The blog is an easy to use function within HubSpot if you want to use paginations. It's possible within a HubDB, but you need to do a lot of customization.
Pros: Listing and single event page will automatically be creating when creating a new blog/event page
Dec 13, 20213:08 AM - edited Dec 13, 20213:09 AM
Participant
How to display data from a single row in HubDB
@dennisedson Thanks for replying! I checked out the page and it still isn't working.. When I click the url of the HubDB row (path) I get a 404 page. How do I solve this? Thanks in advance.