# Hub DB Dynamic pages from selected rows

**URL:** <https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [August 13, 2024, 3:33pm UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404 "2024-08-13T15:33:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonPadbury](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/simonpadbury/32/77566_2.png) [@SimonPadbury](https://community.hubspot.com/u/SimonPadbury)\
**Post date:** [August 13, 2024, 3:33pm UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/1 "2024-08-13T15:33:50Z")

</div>

Hello,

Is there dynamic pages publish some HubDB rows and not others? E.g. for handling drafts.

What I thought might possibly work, but doesn’t:  
HubDB column `.live_status` checkbox for status.  
Then in the template:

```

{% if dynamic\_page\_hubdb\_row.live\_status %}

\<!-- Yes, dynamic page for this row --\>

{% elif dynamic\_page\_hubdb\_table\_id %}

\<!-- Index stuff --\>

{% endif %}

```

That doesn’t work, because the dynamic page is initiated before the template is picked. So, they are all in the sitemap. (But for the unchecked pages, it repeats the index.)

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [August 13, 2024, 6:35pm UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/2 "2024-08-13T18:35:48Z")

</div>

Is it specifically the sitemap you’re concerned about or would a noindex tag do the job?

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity) | [LinkedIn](https://www.linkedin.com/in/barrygrennan)

---

<div class="post-metadata">

**Author:** ![SimonPadbury](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/simonpadbury/32/77566_2.png) [@SimonPadbury](https://community.hubspot.com/u/SimonPadbury)\
**Post date:** [August 14, 2024, 7:53am UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/3 "2024-08-14T07:53:44Z")

</div>

I was wondering whether there was any way for those draft, or, `.live_status` unchecked pages to not be created at all. I want to use this for controling drafts, and for taking down expired dynamic content. E.g. for periodically adding and taking down products from a catalog. Or e.g. for putting up event pages in a calendar, and taking them down when passed.

We can auto schedule publication and unpublication of webpages. I wanted to be able to do the same kind of thing with HubDB dynamic pages -- _because I also want an index feed_. Though I am happy to check/uncheck manually.

I was just using the sitemap to verify that these ‘draft’ dynmic pages were actually being generated. Meaning I might eventually have dozens of identical webpages out there (being the `.live_status` unchecked pages all with the Index instead of the row content).

Good idea -- I can make those unwanted pages get a noindex tag. If I can’t have them be not generated at all, then noindex will have to suffice. Not ideal, but it’ll do if there’s no other way.

---

<div class="post-metadata">

**Author:** ![SimonPadbury](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/simonpadbury/32/77566_2.png) [@SimonPadbury](https://community.hubspot.com/u/SimonPadbury)\
**Post date:** [August 15, 2024, 4:25pm UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/4 "2024-08-15T16:25:45Z")

</div>

Another idea occurs to me: I could have the HubDB dynamic page generated as a _landing page_. HubSpot does not auto-include landing pages in the sitemap XML.

(i.e. what is called a landing page in HubSpot’s parlance, not what Google Analytics calls a landing page.)  
Plus, still have a noindex meta tag.

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [August 16, 2024, 2:52pm UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/5 "2024-08-16T14:52:49Z")

</div>

Well yes, for hiding items from a catelog you could create a boolean column “is\_live” and in your catelog loop only output items where “is\_live” is true.  
For events you’d be looking for it to only show events where the unix timestamp is greater than the current date.  
I’ll try to update this post in a few minutes with some examples.  
But on the sitemap front, yes you’re right, landing pages don’t auto add, that seems like a good idea.  
Here’s a demo of an event listing I did for a client.

```lia-code-sample
{% set get_current_date = unixtimestamp( local_dt ) %}
{% set queryFuture = "&my_event_date__gt="+get_current_date %}
{% set events = hubdb_table_rows(you_hubdb_table,"&orderBy=date" + queryFuture ) %}

{% for row in events %}
{{ row.title }}
{% endfor %}

```

So then for your is\_live column you’d do something like:

```lia-code-sample
{% set live_items = hubdb_table_rows(you_hubdb_table,"&is_live=true" ) %}

{% for row in live_items %}
{{ row.title }}
{% endfor %}

```

None of that’s been tested, so you’ll have to fiddle around but it’s the basic idea

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity) | [LinkedIn](https://www.linkedin.com/in/barrygrennan)

---

<div class="post-metadata">

**Author:** ![SimonPadbury](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/simonpadbury/32/77566_2.png) [@SimonPadbury](https://community.hubspot.com/u/SimonPadbury)\
**Post date:** [August 19, 2024, 8:01am UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/6 "2024-08-19T08:01:01Z")

</div>

Thanks Barry.  
I’m going for having the date(s) as a text field, because some are multi-day conferences. My users can put what they like in a text field. Then for ordering and inserting more conferences, they can handle that by HubDB row drag-and-drop.

---

<div class="post-metadata">

**Author:** ![GiantFocal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/giantfocal/32/41969_2.png) [@GiantFocal](https://community.hubspot.com/u/GiantFocal)\
**Post date:** [August 15, 2024, 6:22am UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/7 "2024-08-15T06:22:33Z")

</div>

I don’t think hubDB has that feature yet. It would be great if it does, though.

As @BarryGrennan mentioned, the only workaround is to add a noindex based on a column value. Just remember to exclude all “draft” items from the listing.

Best regards,

**Abraham Ernesto**

---

<div class="post-metadata">

**Author:** ![SimonPadbury](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/simonpadbury/32/77566_2.png) [@SimonPadbury](https://community.hubspot.com/u/SimonPadbury)\
**Post date:** [August 15, 2024, 4:28pm UTC](https://community.hubspot.com/t/hub-db-dynamic-pages-from-selected-rows/114404/8 "2024-08-15T16:28:15Z")

</div>

Yes, I would do the same trick of `.live_status` on the listing, to disinclude the “drafts”.
