Home App Docs Blog Github

Can I embed a Builder Page into a Data (Content) Model?

I know that a data model can have an HTML field type, which supports rich text, HTML code, etc.

However, this editor is not as easy to use as the the Page or Section models on Builder.

I was wondering whether I can take a record in a Page or Section model and bring its HTML into a field on a data-only model?

Hi @jballo great question!

We dont have an automatic way to link an HTML field type to an existing page/section model, but you definitely could add it manually to a page. Once you have your data model, just paste whatever HTML content you want into the HTML field

Now just pull that data model onto the page as you normally would, and you should have access to that HTML which you can bind to a Custom Code component,
Screen Shot 2022-01-11 at 1.06.30 PM

or access within your app how you normally would access any field on a data model.

Try it out and see if that works for you!

Side note, we have a built in way to copy your builder HTML from a page/section by selecting Get Code in upper right corner
Screen Shot 2022-01-11 at 1.01.14 PM
Selecting HTML/JS/CSS

And copying any relevant code. Keep in mind this Get Code window is currently in Beta, so you may have a few issues, but feel free to send them our way and we can document them or try to address. If that isn’t working , you can also just copy the live HTML from your page as well, that should be a bit more failsafe. :slight_smile: Good luck!

Yeah I saw that you can paste HTML in manually - that’s adds a fair amount of manual steps to the workflow.

Perhaps can this be turned into a feature request, to be able to do this automatically? I saw that the Reference field type exists, which is nearly the same feature, but just refers to the other model’s ID, rather than bringing in its actual attributes / HTML.