Skip Navigation

[Resolved] Bug – Beaver Builder Module Classes Not Working

This support ticket is created 7 years, 7 months 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 6 replies, has 2 voices.

Last updated by SteveW6501 7 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#434629

In the Beaver Builder / Toolset integration, you can assign types fields to any module property that has a text field. For some reason, the module class field doesn't work. The type fields don't have any effect. If my types field has the name of a class and I assign the class of a module to that field, it has no effect. If I type in the name of that same class directly it does.

#434930

Are you talking about HTML Classes?
ShortCodes should not be used to populate any HTML class.

Can you show me with a few steps how I can reproduce this in Beaver?

The intended usage of Toolset ShortCodes is to display content, not to pass data to populate any (also HTML) attributes or properties.

#435003
bb_toolset-class.jpg

If you open up any Beaver Module to set the properties, go to the advanced tab, scroll to the bottom and you'll see the ID and Class input boxes. There is the orange plus next to them. Click on the orange plus next to the class input box. Choose a shortcode for a field that has data in the custom post that is the name of a css class.

There's no error or problem in doing this. It just doesn't work.

Since the mechanism is already there to make this happen, it would be AMAZING if this could work. Then there would be the possibility to dynamically change the style of pages from Types fields. It would make the incredible Toolset/BB integration even more incredible. If the Types shortcode is just resolving to the text data that is in the custom field, I don't see why this doesn't work.

#435129

It works fine on my end.

I use the Free version of Beaver Builder but this should not be a issue.

1. Create a Content Template

2. Style with Beaver Builder

3. Insert a Row

4. Insert a Text Cell module

5. Insert the [wpv-post-id] as ID and [wpv-post-type] as Class.

6. Publish

On the Front end on a Post using this Content Template I now see the executed Post ID and Post Type

You can analize the HTML code with the Debug Console of your browser, where you will see the relevant Data.

It seems though that this does not work with autoclosing Types ShortCodes holding apostrophes.

Can you confirm that the problem only exists with ShortCodes that are autoclosing and hold apostrophes?

#435308

So I was able to confirm this. If you use insert a tag like: [types field="class-1'][/types] it doesn't work. But if I use a tag like [wpv-post-slug] and add to my css stylesheet .section-1 (which is the post slug) it works.

So what to do now - I need to access the post's custom fields where I'll store the name of the CSS class. How can I do that given this limitation?

#435511

For now there is no solution.

I am also not sure we can solve this for good, because, WordPress basically does NOT want you to populate HTML with ShortCodes (attributes and such)
Also, basically it's only possible to pass HTML to ShortCodes with Views, this is all only possible because we use a Custom ShortCode parser.

WordPress explicitely is not allowing this natively since 4.2.3
https://make.wordpress.org/core/2015/07/23/changes-to-the-shortcode-api/

I have to consult this with the Toolset Lead Developer.

I will then update you here how we will proceed.

I can for now say that we can not fix this on the fly. This will require time, and I think the soonest we can add a Fix for this (if we can) is by Views 2.3, which has no ETA yet and is not finished developing.

For now you should use conventional methods (hardcoded classes) or no Types ShortCode but onyl Views ShortCodes.

It woudl be helpful if you coudl also confirim what I see in my install, that it actually is due to the autoclosing ShortCode and not the Apostrophes.

I tested this and it seems only happening when you use [types][/types] ShortCodes.

#438296

Ok, I've found a workaround. Thanks.

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