Adding a class to a link in text editor

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
I am using 3.9. When I navigate to a topic page or product page and try to enter certain classes into the source code (from the tools menu), the classes are removed once I click ok. For example, I will try to put <a class="someclass" href="#"></a> but it does not stay that way. Can someone tell me why this is? My solution is to create topic page templates but that is pretty time consuming and limited when I have to change certain things across the site.  Any help would be appreciated.
5 years ago
Hello,

Try setting 'True' for 'adminareasettings.richeditorallowjavascript' from Configuration -> All settings in admin.

This should work. If you don't find a solution either, let us know. We have used same on our website too.
5 years ago
I should specify, sorry. The code I am trying to use is something like this:

                <a href="/page1" >
                    <div class="someClass">
                        <img src="Content/Images/uploaded/image1.jpg" alt="Image 1" class="hoverImage">
                        <div class="hoverOverlay">
                            <div class="hoverText">SOME TEXT GOES HERE
                            </div>
                       </div>
                    </div>
                </a>


In this example, the <a> gets removed even before I click save.  The javascript setting seems to not apply to this.
5 years ago
Hello,

You need to set following value for setting 'adminareasettings.richeditoradditionalsettings' from admin -> Configuration -> All settings.

Value: settings.valid_children= '+a[div|i|span|img|p|ul|ol|li|h1|h2|h3|h4|h5|h5|h6]';

This works like charm. Let us know if you have other issues.

Thank you,
Atul
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.