Jump to content

Recommended Posts

Posted

I'm not sure if this is the correct section to post this, but anyway, I've run into a small issue with adding links in CKeditor. I need to apply a class and rel attribute to some links.

I've added the appropriate classes, etc in the ProcessPageEditLink module via the insert link dialogue, and the class can now be applied easily. I also tested with the title and target attributes and they also can be applied, however the rel attribute keeps getting stripped out. Any ideas why this might be?

Posted

You can switch off 'ACF' in your CK Editor settings which will stop the editor stripping any markup

If you just want to allow 'class' then go to CK Editor settings for your field and find 'Extra Allowed content'
and enter in there the following:

*(*)

This should allow you to put classes without them being stripped.

 

Posted

@pwired I tried turning off ACF, didn't help. The class can be applied with no problems, as can the target and title attributes from the same dialogue box, only the rel attribute gets stripped, even though it's applied the same way. To clarify, it gets applied as it should (as shown in the preview at the bottom of the dialogue), but when the page is saved it gets taken out.

Posted

i ran into something like this, maybe it's the html purifier? (can't test right now);

after you close the dialog, if you view source, is the rel attribute still there?

Posted

@macrura I think I did try turning off the HTML purifer as well with no success, but I'll try that again when I get chance to be sure. Yeah, after closing the dialogue the rel's in the source. Save the page and go back to check and it's gone.

Posted

@macrura just tried turning HTML purifier off and that worked, the rel attribute doesnt get stripped out. Thought Id already tried that but must have missed it out.

  • 1 year later...
Posted
On 14/07/2015 at 10:01 AM, houseofdeadleg said:

@macrura just tried turning HTML purifier off and that worked, the rel attribute doesnt get stripped out. Thought Id already tried that but must have missed it out.

I guess rel links should always be allowed...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...