Help / Feature / Just me missing something

A project I built, was taken over by someone else. They implemented something called Power BI which is a bunch of graphs loaded into iframes. Initially the client thought having someone in their own timezone would work better (I’m in South Africa, the client is in Australia).

The issue.

On all these pages I get the dreaded “can’t load the page message” and this means i need to make changes to the pages without being able to view the changes in the builder. The cause is that the iframes don’t load because they load based on url parameters in the url which aren’t present in the builder.

I have a few other projects and scenarios where this is also a problem.

Possible solution

Have the ability in the builder preview, when selecting the preview page to view that there is an option to add a custom option where we can add URL parameters.

Another question more or less related

Occasionally I have assets or elements where I want conditionals to either display, hide or stop something from doing something when I’m in the builder.

On another build I used to use JavaScript to determine if a page was in the builder and in this way stop certain assets from running. After changes to Pro at some point this stopped working. In this example we had some redirects taking place in certain instances. This meant the builder would redirect back to displaying the home page when we were trying to edit the page in the builder. The JavaScript prevented this.

What is the best way to determine if we are in the builder or not. Both with JavaScript and PHP. I haven’t looked around too much but it seems even with PHP the usual “SERVER” variables return the page URL and don’t show that you are in the builder.

Through JS

window.csAppData.isPreview

Through PHP

// Preview is rendering
did_action( 'cs_element_rendering' )

// Preview Frame booting
add_action("cs_before_preview_frame", function() {});

If your trying to add some GET parameters to the frame I couldn’t find any way right off the bat, it looks like it’s missing a filter for this which I can add.

How were you checking before? We can possibly add a polyfill. Let me know if this helps!

1 Like

Thanks for the response. Those will help a lot.

I haven’t previously figured out how to get a preview to work once that error starts showing. Usually I end up editing things blindly and previewing on the front-end.

What would be awesome if there was something like the ability to choose a product when we are viewing a Woo layout but with an “other” option which permitted an input box where we could just add the url parameters. At least this way we could preview the page in the builder.

url-params