Jump to content

Adding links in CKEditor


houseofdeadleg
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

  • 1 year later...
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...

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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