SOLVED: Shortcode not rendering

Bricks Version: 1.4RC2
Browser: Firefox Dev
OS: Windows 10
URL: Local site

Hi,

I decided to post this in bug category, but I’m not 100% sure it is bug. There are 2 main observations that I found:

  1. Smaller one, sometimes (most times?) the shortcode in builder is not rendered exactly as it is rendered on frontend. But not big deal, as we can still see height/width and approx. layout of the shortcode content - form, for example.

  2. This one is much more annoying. Sometimes shortcode content doesn’t even show up in builder. Yes, it shows up in frontend, but it is very had to style it. Take a look at the screenshots below:

On this screenshot you can see that I have a container and shortcode wrapper inside. Before I inserted shortcode into shortcode wrapper, there was this blue box “No shortcode provided”, but after I inserted shortcode, the is just nothing. Nothing even shows up when I select it, so I can’t possibly know where the shortcode is located and what are the sizes.
Here, the shortcode wrapper is selected, but nothing shows in builder.

Even if I select the container from structure panel, there is nothing selected in the builder. Sure, if I put “Header element” for example in the container, then it works and the selection appears, but this is not ok.

If I hover with mouse, the container is there, but empty :slight_smile:

This might be related to this problems alredy on forum:

I don’t know if this is because of using Ajax to show shortcodes and it is not yet available or what, but I think that in this case, is shortcode is not rendered, it should at least have some min width/height so that we see where it is :slight_smile:

Or maybe I’m doing it all wrong :smiley:

Sorry for long post,
Matej

Hi Matej,

Thank you for your report.

Usually, this happens because the shortcode cannot be rendered via AJAX. Bricks use AJAX to refresh the elements on the Canvas. If the shortcode is not “registered” during an AJAX request, Bricks doesn’t have any possibility to render it.

In the case of the mb_frontend_form shortcode, Meta Box is preventing the output if the request is done via admin-ajax (is_admin()).

In the meantime, you’ll only see the correct output by refreshing the builder.

We’re working to find an alternative to avoid this issue.

Best regards,
Luis

Related with: WIP: Display of Shortcode content disappears from Editor after any change is made

2 Likes

Hi,
Thank you for your response. I’m glad that your are looking into it and I hope you will find alternative someday.

Have a nice day,
Matej

Hi Matej,
with Bricks 1.5beta we’ve introduced a new render method: WP REST API Render instead of Ajax.

Right now, this is an experimental feature but worth giving it a shot. We’ll improve it over time.
If you encounter any issues with it, you can disable it within Bricks » Settings » Builder.

Best regards,
timmse

2 Likes