CMS Development

Jsum
Key Advisor

HubDB Dynamic Pages - A different table for each level?

SOLVE

Hi all,

I've ran into a bit of a confusing situation.

I've made a lot of dynamic page templates before but they've only been 2 levels, the listing and the row. 

I have a client using the Focus theme. They set a lot of content to a page and want the page to also be dynamic, with parts of the content being filled out by the hubdb row. the page uses a drag-and-drop grid.

Messing around, I wrapped the dnd area in the dynamic page logic. this made the dnd area unavailable. So I went in and cloned and edited the modules a bit to check for row data and now the row pages do what is expected.

but the row page has child pages so:

agents/agent1/relocation
agents/agent1/mortgage
agents/agent2/relocation
agents/agent2/mortgage

now my template logic is based on the dynamic page level. I tried adding a dnd area to each level condition, but only the listing level dnd area shows up on the editor.

obviously if I add all of the modules outside of the condition then they will all appear on every page level.

I considered using export_to_template_context to inject the module contents in the appropriate level condition, but with these custom modules that basically requires rebuilding the modules within the template, and for some of the Focus modules they use things like {{scope_css}} that are module based and do not work in the template so it would require an entire refactor.

What I would like to do is use a different page for each level - listing, object, child page 1-3. Second to that, I'd like to be able to add all of the modules for each page type into the template, edit them from the page editor (even if I can't preview the content) and have the condition work to show the correct content for the correct page level. 

Any ideas?

0 Upvotes
1 Accepted solution
Anton
Solution
Thought Leader | Partner
Thought Leader | Partner

HubDB Dynamic Pages - A different table for each level?

SOLVE

Hey @Jsum

long time no see buddy. How you're doing?

 

You'll require the child-table function for a "HubDB-ception". Had a recent project that was kinda similar - that's def. not an easy thing and you have a few ways you could go. 

  1. Drop the dnd functionality, create some "static" layout and go with a lot of booleans/selects in the HubDB to control layout of pages. But this will make the tables quite hard to maintain. So configuration modules with export_to_template_context is a great idea. Pro-tipp: You could pass a module path to a HubDB text/select field and change the module in the layout
  2. Create partially "dnd-able" templates which would have parts with dnd-areas and others with content from HubDB
  3. Ditch the HubDB and use the blog functionality. This would give you dnd for the listing and some sort of dnd in the detail page. Downside is that the /tag page is generated automatically and you can't change the slug. Furthermore you'd - mostlikely - need to recreate modules from the theme for the blog-post

 

Hope this helps

 

 

best, 

Anton

Anton Bujanowski Signature

View solution in original post

2 Replies 2
Anton
Solution
Thought Leader | Partner
Thought Leader | Partner

HubDB Dynamic Pages - A different table for each level?

SOLVE

Hey @Jsum

long time no see buddy. How you're doing?

 

You'll require the child-table function for a "HubDB-ception". Had a recent project that was kinda similar - that's def. not an easy thing and you have a few ways you could go. 

  1. Drop the dnd functionality, create some "static" layout and go with a lot of booleans/selects in the HubDB to control layout of pages. But this will make the tables quite hard to maintain. So configuration modules with export_to_template_context is a great idea. Pro-tipp: You could pass a module path to a HubDB text/select field and change the module in the layout
  2. Create partially "dnd-able" templates which would have parts with dnd-areas and others with content from HubDB
  3. Ditch the HubDB and use the blog functionality. This would give you dnd for the listing and some sort of dnd in the detail page. Downside is that the /tag page is generated automatically and you can't change the slug. Furthermore you'd - mostlikely - need to recreate modules from the theme for the blog-post

 

Hope this helps

 

 

best, 

Anton

Anton Bujanowski Signature
Jaycee_Lewis
Community Manager
Community Manager

HubDB Dynamic Pages - A different table for each level?

SOLVE

Hi, @Jsum  👋 I hope you've been great. Thanks for the interesting question.

 

Hey, @Anton @ChrisoKlepke @alyssamwilie, have you tackled anything similar in your recent project work?

 

Thank you! — Jaycee







HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.


Learn More.





Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !