We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Dec 10, 2021 9:56 AM
Hi all,
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).
Can anybody help me with this? Would be awesome!
Thanks guys!
Jorg
Dec 23, 2021 4:43 AM
Hi @JDam ,
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.
Dec 15, 2021 2:03 AM
@dennisedson, thanks for mentioning!
@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:
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
Cons: Is is harder to add custom fields to display onto the listing page, but is possible with Hubl supported tags and export to template content.
Dec 13, 2021 3:08 AM - edited Dec 13, 2021 3:09 AM
@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.
Dec 14, 2021 10:54 AM
You will probably need to share some code so we can see what you are working with.
@Indra is a brilliant fellow who might be able you help you out further!
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |
Dec 10, 2021 3:14 PM
You should check out this document on HubDB Dynamic Pages. I think this is what you are after.
Also! Shameless plug, you should come to our workshop next week where we will be working with making dynamic pages and all things data driven content!
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |