I am building a gravity form and I’d like to pull in content from another page using shortcode in an HTML block. This part works fine. My content from the other page shows up in the html block as desired.
However, it doesn’t retain the page layout. Is there anything we can do to keep the page builder layout within the form’s html block?
My purpose in pulling in the data this way is so we can repurpose that content for other forms and only have to edit one page instead of 8 individual forms.
I can just drop in some CSS for it, but if there’s a way to retain the page builder settings, that would be a million times better.
Welcome to the BB forums! Hmm, I’m still trying to wrap my head around this, sorry about that. Could you please share your Website URL with me so I could tell you the correct CSS snippet to do this?
The BB assets for a page only gets loaded when you’re on that specific page. You’ll need to apply the fl_builder_global_posts filter so the assets for that page gets loaded globally. Let us know if you need further help with that.
Thanks - I just tested this, Ben. Here’s what happened…
First, the form completely disappeared. I tracked down that now display: none is being added to gform_wrapper. So I disabled that but then the form shows in it’s entirety (some items were hidden by logic) and the content I pulled in via shortcode is still not formatted.
So for my second test, I removed the conditional logic from the form so that section was now always visible. Now the form loads, but it has lost all it’s formatting and the content from shortcode doesn’t have any formatting either.
Could you tell me more about the setup? From what page are you trying to pull the content from? How are you pulling its contents? Where are you placing its contents? Also, there are several JS errors on that page as well causing BB to stop working.
Could you instead try using the Insert Pages plugin to pull the content? I played around with the plugin you’re currently using and it doesn’t seem to work. Also, I’ve adjusted the function as that was what’s causing the JS errors, hiding the form, and etc. You need to place the Page ID of the page you’re pulling the content from, not the page you’re placing the content to.
Ok - I switched to the other plugin. Now the form shows and the html box is hidden until I select the radio button. But when I select it… the page content shows without the page builder formatting.
Actually, I just checked on my end and it seems there’s some kind of problem with the latest version. Any page inserted to another page with BB active doesn’t work. I tried creating a page on your site though, BB Test Page, and you can see there the content is being pulled correctly. I’m going to have to file a bug report for this.
Also, I did test the plugin you’re using before and it still didn’t work with the older version or on pages without BB.
We recently launched a Learndash course where we fed in content from pages via shortcode into a tabbed widget for each lesson. It was a fitness course and some of the exercise videos repeated throughout different weeks of the course. By setting up a single page for each exercise video and text blurb, we were able to just insert the shortcode on the tabbed widget in each lesson. Then, if we needed to update the exercise, we could just open the original page to make changes instead of 100+ lessons.
We didn’t style the original exercise pages with the Page Builder so I didn’t have this issue like I do with this form. If we could get it to work for the html boxes in the form, that would be awesome.
Neat workaround you got there! Definitely saves a lot of time. I just tried the Insert Pages shortcode on an HTML field in GF and it works fine on an older version so you should be good once this will be fixed. I’ve already submitted a bug report as well.
Hi Ben - I just tried this with 1.6.4.2 and it’s still not applying any formatting to the html box with the shortcode. I also cleared the page builder cache and browser cache. Did I miss something?