SOLVED: Custom Classes used on Shortcode Template is not working

Bricks Version: 1.3.6
Browser: Version 96.0.4664.45 (Official Build) (64-bit)
OS: Windows 11 Pro 64bit

Experienced through woocommerce product.

  • Bricks Template shortcode used on Product’s visual/text wordpress editor.
  • Then use “Product Content” widget
  • Classes used on the Template is now not working.

I think this is due to the format bricks class format = .user-class.bricks-class

Hi Richmon,
can you please tell me what is in your template and what you applied classes to, so I can rebuild your setup and possibly reproduce your problem?

Thanks a lot!
timmse

I applied classes to containers, images, basic text elements. maybe try to create a section template. then call it into another page through shortcode.

Hi Richmon,
just to be sure: the styles are not displayed in the builder, but in the frontend, right?

I created a section template with 2 containers, applied a class to each of them with a different background color. When I insert them with the Shortcode Element, Template Element, or as a shortcode in Rich text Element to a page, the styling is not visible on the canvas, but on the frontend.

But, if I insert them directly to the page, all styles are visible instantly, as you can see here :smiley:

So the correct behavior should be, that the styles are always visible, regardless of how you´ve inserted your templates.

i really wanna show some videos on my side, but the client owns it so i cant share it easily.

but can you try what i did? i used the template shortcode on a woocommerce product(backend, worpress editor). then show it through Bricks “Product Content” element?

And to be exact, its a 6th descendant element where my classes not shown.

Style settings is inner because when i tried to change to external, site got broken even if i regenerate files multiple times.

And another note, I inspected it. Classes are in the html tags, but css is missing

Another one, when I view the TEMPLATE, classes WORKS. But when I view the PRODUCT live page, css is not working.

Hi,

I just added the template as a shortcode to a product description and you are right, the styles are not visible. The elements have the class but the styling is completely missing. No matter if they are inline or external styles. I’ll add this to our bug tracker, thanks for pointing it out!

1 Like

The site product page is not supported with just bricks elements that’s how I discovered it.

Hope it will be fixed soon cause I’m using the Custom Code - CSS on settings to make this work

I think it’s great that you know how to help yourself until this is fixed :yum:

Of course, we still try to fix the problem as soon as possible :v:t2:

1 Like

Hi Richmon,
this bug is fixed in Bricks 1.3.7 :partying_face:

I think the error has reappeared in version 1.9.5. I use the shortcode [bricks_template xxx] together with the function “do_shortcode()”. Within the template the whole styling is applied in the backend, but not in the frontend. I have to include the styling via an extra code block.

Hey Weninger,
Can you please show an example of what you mean by

?

Hey @timmse , i encountered a similar issue.

Created a template (type = section). Elements in that template (text, images) have classes and styling applied in the builder. If i use the template via the shortcode element or via the template element on a page, the class attributes and their corresponding styles appear correctly on the frontend.

Problem is, if i try to show the template with a hook, the class attributes appear in the HTML, but their corresponding styles are missing.

Example:
add_action( ‘woocommerce_before_shop_loop_item’, ‘custom_content’ );
function custom_content() {
echo do_shortcode(‘[bricks_template id=“5000”]’);
}

Not a huge issue since i can target the classes elsewhere and the styles are applied normally.

Hey @Stathis ,
Have you tried adding the section via condition? With something like this, it should actually work:

Hey @timmse, tried this one just now.

scrpcv

Same issue as before, the styles of the classes are missing. That works fine on your end?

Hey @Stathis ,
I’ve just tested it again (using in-builder conditions) and can’t find any problems: my ID and class styles are there.

Please send temporary login credentials, information on which section template it is, and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase.

Hey @timmse, i sent it

Hi @Stathis ,
Thanks for the access data!

I can confirm the problem, but it is not the same problem reported here almost three years ago.
You could temporarily copy all the relevant styles from the template and paste them to Bricks » Settings » Custom CSS, until the issue is solved.

I have added the issue to the bug tracker, but will leave this report as “SOLVED”.

1 Like