Bug with latest admin RTE - div attributes being stripped

Bug with latest admin RTE - div attributes being stripped

shopGroves
Shopify Partner
5 0 0

Can someone report this bug to the Polaris/Admin Shopifolk Team?

Looks like the latest admin RTE is stripping div attributes when expanding. 

 

Steps to reproduce

1. Add in the admin RTE code a div with some attributes, eg <div itemscope>Some Text</div>

 

bug1.png

2. Go back to text mode and add a new line, text or paragraph

 

3. Go back to code mode, the attributes are stripped:

 

bug2.png

 

Here's a video: https://monosnap.com/file/hjpWixH0nSoJWrIyYlsCLQ3efP4lDW

 

HALP - this is causing an insane amount of issues with all my products and blog posts content 😕

Replies 8 (8)

laddisahsi
Shopify Partner
444 44 45

Hi @shopGroves 

Shopify editor might be not allow to add these type attributes in divs
So getting this issue.

Shopify allow classes and Ids as attributes.

Thanks
Shuvam

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
shopGroves
Shopify Partner
5 0 0

I swear this was working up until recently when the RTE was updated.

laddisahsi
Shopify Partner
444 44 45

@shopGroves 

You can use metafields for this.

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
shopGroves
Shopify Partner
5 0 0

Hi - can you plz provide an example? TY 😃

laddisahsi
Shopify Partner
444 44 45

Go to settings > custom data

laddisahsi_0-1736835181452.png


Create products metafields.

laddisahsi_1-1736835209786.png

 

Then you can manage metafileds  data from product admin page.

laddisahsi_2-1736835270966.png



You have to add metafileds ID in product liquid file where you want to display the content.

Thanks
Shuvam

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
shopGroves
Shopify Partner
5 0 0

Thank you - however I don't think metafields would work for us as we're not looking for a dynamic solution. Just to write some FAQ divs into our posts manually. This used to work I'm sure 😕

laddisahsi
Shopify Partner
444 44 45

Need to add different Faqs for each product?

Metafield is best solution for this, To manage the FAQ's dynamic for all products.

If you want to use the same  FAQ for all the products then we can manage that through the coustomizer.

using the custom JS and css we create the FAQ acoordion.

It will take approx 3-4 Hours.

If need any help from my end Please let me know, Contact info is in signature.

With Regards,
Shuvam



 

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
shopGroves
Shopify Partner
5 0 0

Thanks for your reply. However, you are missing the point. I'm not looking for a metafield dynamic solution nor an accordion FAQ. 

I just need to add manual itemscope  info data in the RTE editor of my blog posts. It used to work with the previous RTE admin version, but now it is stripping those attributes if you follow my steps in the first post ^

Try adding the following in the RTE editor code option and save in product or blog article - looks good.

 

<div itemscope itemtype="https://schema.org/FAQPage">

    <div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">

        <h3 itemprop="name">When is the best time to shop at discount home stores?</h3>

        <div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">

            <div itemprop="text">

                <p>The best time to shop at discount home stores is typically early morning on weekdays when new shipments arrive. Most stores receive deliveries 2-3 times per week, with Tuesday and Wednesday being common restocking days. Additionally, shop during seasonal transitions (January/February and July/August) for the deepest discounts on clearance items.</p>

            </div>

        </div>

    </div>

</div>

 


Issue is when you go back to the editor to add some lines or text, and re-save, it will strip those said attributes.

This is a bug.