YAFLogo

Mariette
  • Mariette
  • 78.4% (Friendly)
  • YAF Commander Topic Starter
8 years ago
If I use the YAF CKEditor and past a URL by using CTRL-V there is no 'nofollow'. When I paste in BBCode and save the post there is (target="_blank" rel="nofollow") added to the link. How do I get to work also when I paste a link with CTRL-V?

This is in YAF for DNN version 2.2.3 and DNN 8.0.4


MJK
Sponsor
Mariette
  • Mariette
  • 78.4% (Friendly)
  • YAF Commander Topic Starter
8 years ago
I have found a little solution that helps me a bit. In config I add:

CKEDITOR.on( 'dialogDefinition', function( ev )
{
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;

// Check if the definition is from the dialog window you are interested in (the "Link" dialog window).
if ( dialogName == 'link' )
{
// Get a reference to the "Link Advanced" tab.
var advTab = dialogDefinition.getContents( 'advanced' );
var relField = advTab.get( 'advRel' );
relField['default'] = 'nofollow';
}
});

But that does not work on pasting the URL. It only sets 'nofollow' in the dialog


MJK
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
8 years ago
You need the autolink plugin

http://ckeditor.com/addon/autolink 

that converts an url to a link if you paste the url