You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#114051 Style bug, class attaches to all elements

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Wednesday, 28 June 2023 13:40 BST

buro26
I want to wrap my h2 and p in a single div/span by using styles.
The problem i encounter is that i configured my style to only target h2 and p but when i select both and then apply the styling each element in the jce editor gets that element (Like i mean everything h3, ul, li etc). Am i doing something wrong or is this a bug?
I added some pictures for reference.

We use JCE Editor Pro 2.9.38

Attachments

Ryan
Please try JCE Pro 2.9.39 Beta - https://www.joomlacontenteditor.net/downloads/editor/pro/development

In your custom style configuration, set the Tag option to None (Apply to Selected Tag).

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

buro26
I already tried that one but unfortunately that gives the class to each element. I want the class to wrap around the 2 elements

Ryan
[quotePost id="114056"]I already tried that one but unfortunately that gives the class to each element. I want the class to wrap around the 2 elements[/quotePost]

Have you installed JCE Pro 2.3.39 Beta? This is working in my tests with the span change.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

buro26
Yes i tried with tag span and tag none. Both create a own span with class instead of one wrapper span with the class:
<h2><span class="featured-red">Uitgelicht rood</span></h2>
<p><span class="featured-red">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span></p>

it should be:
<span class="featured-red">
<h2>Uitgelicht rood</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</span>

Ryan
it should be:

Uitgelicht rood

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

No this is not what it will do. Because you are using a selector, then the class is applied only to those elements, it is not wrapped in a span, as block elements (p, h2 etc.) cannot be wrapped in a span. The result should be:

<h2 class="featured-red">Uitgelicht rood</h2>
<p class="featured-red">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.