Apr 20, 2021 12:54 PM
I currently have a dynamic page set up with a HubDB table that has multiple subpages like so:
I want to gate the subpages behind a hubspot form and upon form completion, ungate the content.
Setting the dynamic page to private doesn't work because I still want the listing page to be public.
Is this possible and if so how can I accomplish this?
Apr 22, 2021 6:29 AM
Hi @ATran4 (thanks @dennisedson). I think to do this you would have to add your own form modal to the subpages that appears on load if the contact is not known and remove it after submission. Disclaimer: using the contact HubL variable will disable page caching.
{% if dynamic_page_hubdb_row %}
{% if contact.email != '' %}
<div id="myModal">
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js">.
</script>
<script>
hbspt.forms.create({
portalId: "[portal id]",
formId: "[form id]"
});
</script>
</div>
{% endif %}
// rest of subpage
{% elif dynamic_page_hubdb_table_id %}
// listing page
{% endif %}
Apr 22, 2021 11:57 AM
Hi again,
So I tried this solution but was unable to get it to work.
Printing out the contact variable gave an empty dict object and using {{ contact|pprint gave (SizeLimitingPyMap: {}) }}
Any advice?
Apr 21, 2021 12:24 PM