Skip Navigation

[Resolved] Shortcode in Custom Field and Brizy

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 22 replies, has 4 voices.

Last updated by Christian Cox 3 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1573847

Hi,
I would like to store a shortcode in a Types Custom Field "custom-form",

[formidable id=25 title=true description=true]

Then insert a Shortcode Module in Brizy with

[types field='custom-form'][/types]

Sadly the formidable shortcode won't be executed.
I did try also with a Text Module in Brizy but it doesn't work.

Any suggestion is appreciated.

Thanks

Best

#1574805
3-results.png
2-brizy.png
1-wysiwyg.png

Hi, I just ran a quick test with Formidable, Brizy and Types, and I was able to get a Formidable Form to render correctly in my test site. Screenshots attached here. Use a Types WYSIWYG custom field to store the shortcode. Then you can use a Types field shortcode in a Text Element or in a Shortcode element to display the Form:

[types field="my-wysiwyg-slug"][/types]

I didn't try any other Brizy elements, because I think the main requirement here is you must use a WYSIWYG field in Types. Let me know if that isn't working for you and I can take a closer look.

#1583533

This did the trick, thanks!

I still cannot get it work when using Toolset custom fields.

I have some custom image fields, that I use to store an alternative picture of the standard "Featured Image".
If I use the normal shortcode [types field="alternative-picture-slug"][/types], the image won't resolve in Brizy (tested with the Text Module, Shortcode Module and Embed Molume.

Any idea is really appreciated.

Thanks

#1584181
Screen Shot 2020-04-13 at 12.47.37 PM.png

Seems to work fine for me in a local test (see the green icon image in the screenshot here, that's a custom field). I'm not sure what's going on there. In my local test, I have Brizy enabled for building Posts. The custom field is located in the Post I am designing with Brizy. In your test, where is the custom field (on which post) and where are you adding the custom field shortcode in Brizy?

#1586033

Hi, I think I have found the problem, but not the solution.

With Brizy you can create templates and assign them to specific posts/taxonomies.
Something similar to the Toolset templates.

hidden link

If I insert my shortcode in a Toolset custom field and use the Brizy Shortcode module directly in a post, it works.

hidden link

But if I create a Brizy template, with the same Brizy's shortcode module, assign this template to all posts, the shortcode doesn't resolve.

hidden link

I have a test site if you want, with the 2 examples. Let me know if you want access to it.

Thanks

#1587375

Yes please provide access. I'm not able to get Brizy templates to work at all on my local test site.

#1587539

hidden link

#1588903

Yeah this is what happened on my site as well, and I wasn't sure why the template was not applied. Looks like you have to edit the post and click "Edit with Brizy", otherwise the template isn't applied. Now the template is applied and you can see the shortcode resolved in both posts.

hidden link
hidden link

#1589097

I get your point, but that's exactly what we are trying to achieve.
The good thing about Brizy is that you create templates for every kind of post/taxonomy.
The user has to fill only standard WP fields (or custom fields) and Brizy is taking care of showing them in a nice design in front end.

Everything works fine, no need to apply the "Edit with Brizy" button, except this problem with the shortcodes and Types custom fields.

Please notice that if I add the [ameliabooking] shortcode in the normal WP post content it works.
hidden link

Any other idea?

Thanks

#1591611

Everything works fine, no need to apply the "Edit with Brizy" button, except this problem with the shortcodes and Types custom fields.
No, it doesn't work fine as far as I can see. The template is not applied at all to the post unless you click "Edit with Brizy". It has nothing to do with shortcodes being rendered. None of the other content in the template is shown.

#1596421

Yes, it does work.
Here an example with a CPT "events"

- I have created a post using only the classic WP editor, raw title, body and featured image
hidden link

and so it's how it looks with a standard WP theme
hidden link

- I have created a Brizy template
hidden link

and assigned to apply for all "events" CPT
hidden link

And so it's how it looks now, WITHOUT having to click "Edit with Brizy"
hidden link

#1597807

Okay I see what you're saying, and also why my tests had very different results. I was testing with a WYSIWYG field in the template, but your demonstration does not include a WYSIWYG field. So I added a WYSIWYG field to the Events post type for you. Then I created a test Event and placed a shortcode in that WYSIWYG field. I placed that WYSIWYG field in your Brizy template using a shortcode block and the Types field shortcode:
hidden link

[types field="event-wysiwyg-test"][/types]

Now you can see what I'm talking about at my test event and your test event as well:
hidden link
hidden link
White page, the template does not appear to be applied at all. So I went to Brizy settings and enabled Brizy for Events in the General tab. Then I created another Event post with the same shortcode content in the WYSIWYG field, and clicked "Edit with Brizy" before publishing the Event post. Now I'm seeing the same results in this Event - a white page with no template applied. So the Brizy template is just not working when a WYSIWYG field is added. I guess it worked for me before for some other reason I don't fully understand?

At any rate, whenever there is a white page that could indicate a server-side error. Can we take a look at the server logs to see if anything unusual is captured? It looks like you may have one already set up here: hidden link
Can you use FTP to see if there really is a file here, and if so, download it? Please open the file with any text editor program and copy any logs from the last day or two to paste in your next reply.

I'll take a look at those logs to see if there's anything obvious that might be contributing to the issue here. If not, then it seems we have a compatibility issue with Brizy templates and WYSIWYG fields in general.

#1597881

I don't have any error.log, because it wasn't enabled in wp-config.php
I have set it now to true

If you want I can give you ftp access.

#1597905

I can paste the apache log of today.
I see only an error for a "shortcodebtn" plugin that I have now deleted, but it doesn't make any difference.

Sat Nov 23 07:14:40 2019 0 178.162.222.103 143 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/assets/css/style.css a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:40 2019 0 178.162.222.103 21989 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/assets/css/font-awesome.min.css a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:40 2019 0 178.162.222.103 121464 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/assets/css/bootstrap.min.css a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:40 2019 0 178.162.222.103 210010 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/assets/css/bootstrap-iso.css a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:41 2019 0 178.162.222.103 1028 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/assets/js/shortcode.js a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:41 2019 0 178.162.222.103 36824 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/assets/js/bootstrap.min.js a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:41 2019 0 178.162.222.103 2632 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/shortcode-btn.php a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:41 2019 0 178.162.222.103 86929 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/front/assets/js/jquery.min.js a _ o r puntoinfo ftp 1 * c
Sat Nov 23 07:14:42 2019 0 178.162.222.103 357 /home/puntoinfo/public_html/test/wp-content/plugins/shortcodebtn/shortcodebtn.php a _ o r puntoinfo ftp 1 * c
Thu Apr 23 12:36:24 2020 0 88.12.135.175 3181 /home/puntoinfo/public_html/test/wp-config.php a _ o r puntoinfo ftp 1 * c

#1598043

Okay sure, if you would like to provide FTP access I will activate those private reply fields here.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.