PDA

View Full Version : Why does the text editor not save changes to the Links ?



Pete Young
March 31, 2019, 11:25 AM
If I add a text to the text editor and add a link then add target and reliance it does not save for example if I add as below

my test link here

my test <a href="http://mysite.com" rel="nofollow" target="_blank">link</a> here

SAVE

after I save it I end up with

my test link here



my test <a href="http://mywebsite.com">link</a> here


the attributes target and rel are deleted on save ? where and how do I fix this ? Please

Bahram Soltanirad
March 31, 2019, 05:00 PM
Pleae follow these links
https://forum.flynax.com/showthread.php?4648-Follow-Page-No-Follow-Links-How&highlight=Ckeditor
https://forum.flynax.com/showthread.php?4952-Link-with-target-about-not-saved-on-page&highlight=Ckeditor

Pete Young
March 31, 2019, 08:54 PM
ok brilliant the second one is what I need as it still exists in 4.7.0

thank you

Pete Young
April 1, 2019, 11:38 AM
$config->set('Attr.AllowedFrameTargets', array('_blank','nofollow'));


I added the code as above but it spits out as below, apparently it has something to do with the ck editor changing things around ?



my test <a href="http://mywebsite.com" rel="noreferrer noopener" target="_blank">link</a> here


as best I can do is remove the nofollow option ? and then use the first links options to apply the no follow.

Edit; I removed the no follow attribute from code


$config->set('Attr.AllowedFrameTargets', array('_blank'));


and now if I just run the blank option in the link I still get that "noreferrer noopener" in the code ? what's this all about ?


my test <a href="http://mysite.com/" rel="noreferrer noopener" target="_blank">link here</a>


Edit 2, I can read that the extra code is related to security but also read that


UPDATED 8/30/17! A READER JUST LET US KNOW THAT THE NOREFERRER ISSUE HAS BEEN FIXED! TINYMCE NO LONGER FORCES NOREFERRER TO BE ATTRIBUTED TO EXTERNAL LINKS THAT OPEN IN NEW TABS! - V 4.6.3

meaning we must have onlder version of editor ?

confusing stuff

Bahram Soltanirad
April 1, 2019, 04:04 PM
Hello Pete, if you like to force ckeditor to save all links with nofollow and _blank, use

$config->set('HTML.Nofollow', true);
$config->set('HTML.TargetBlank', true);
If you like to permit users to define links with nofollow and _blank , use

$config->set('Attr.AllowedRel', array('nofollow'));
$config->set('Attr.AllowedFrameTargets', array('_blank'));

You can use _top,noreferrer,noopener with above arrays

Pete Young
April 1, 2019, 08:54 PM
ok thanks Bahram, will try this tonight.

Wish I new how to program with this stuff, getting better slowly.

Pete Young
April 2, 2019, 09:36 AM
$config->set('Attr.AllowedFrameTargets', array('_blank'));
$config->set('HTML.Nofollow', true);

All good I used a combination, but all good options, thank you again.

Pete

Andrew Wildsmith
September 1, 2019, 11:28 AM
hi where does this code go ?

Pete Young
September 1, 2019, 11:38 AM
hi where does this code go ?

follow the links in post #2