Automatically adding nofollow, noopener & noreferrer to external links & opening in a new tab?

To help with SEO we'd like to be able to force all external links in content & comments to have rel="noopener noreferrer nofollow" added (apart from any 'authorised' domains which we can define in a list).

And to help with site usability we'd also like to force target="_blank" to be added to all external links.

Is this something that's built into Verint somewhere (I've had a good look around, but can't find anything).

Maybe this is a feature coming in v12?

Parents
  • There are no changes in 12 with regarding this.  You could accomplish this with an Automation using Content.BeforeCreate and Content.BeforeUpdate to make the required changes to all content.  Or more specific events depending on where you want this to occur.

  • I've been trying to get this working with the content events you suggested. The automation is triggering, and I'm able to inspect the HTML that's about to be written using this snippet;

    var bodyHTML = context_v2_automationTrigger.Arguments.GetReviewableText()['Body'];

    I'll be able to write code to modify the links easily enough, but how do I then pass that modified HTML back in so it overrides what gets set in the content?

    I don't see any setters in the script API docs here and here.

    When I tried using Add, it threw an exception;

    // Didn't work
    context_v2_automationTrigger.Arguments.GetReviewableText().Add('Body','xx');
    
    // This didn't work either
    context_v2_automationTrigger.Arguments.GetReviewableText()['Body'] = 'xx';

  •  I don't suppose you could take a look at this and provide some guidance, please?

  • Hello Russ from 4 Roads here. Here's the way you could do it:

    var txt = context_v2_automationTrigger.Arguments.Body
    //core_v2_eventLog.Write(txt, { Category: "4-Roads", EventType: "Error" })
    var newTxt = core_v2_utility.Replace(txt, "test", "best")
    context_v2_automationTrigger.Arguments.Body = newTxt

    The above snipped assumes that the automation was created with events ForumReply.BeforeCreate
    ForumThread.BeforeCreate (Any "BeforeCreate"). Also make sure your automation is actually getting triggered.

  • Thanks Russ. I've had some time to look at this today. That approach generally works, but it's a bit more long-winded that just having a couple of events looking at *any* Content that's created.

    Maybe I need to raise this as an Idea so we can get it exposed in the existing Content.BeforeCreate event, unless this is Coming SoonTM  ?

    Unfortunately there are also a few types that don't have a BeforeUpdate/BeforeCreate event (like Calendar Events & Polls). And some that don't have a Body argument, and instead it's Description (like Ideas).

  • Maybe I need to raise this as an Idea so we can get it exposed in the existing Content.BeforeCreate event, unless this is Coming Soon

    This thread was linked from another thread, so I thought I'd follow up. For generic HTML modification, instead of using the Content events, the Html.BeforeCreate /BeforeUpdate events are more suitable. These are executed for content and support modification. The Html events are used to implement other global HTML behaviors and would prevent needing to handle every content type individually within the platform.

Reply
  • Maybe I need to raise this as an Idea so we can get it exposed in the existing Content.BeforeCreate event, unless this is Coming Soon

    This thread was linked from another thread, so I thought I'd follow up. For generic HTML modification, instead of using the Content events, the Html.BeforeCreate /BeforeUpdate events are more suitable. These are executed for content and support modification. The Html events are used to implement other global HTML behaviors and would prevent needing to handle every content type individually within the platform.

Children
  • Thanks. 

    For anyone else wanting to do something similar, this code will give you a head start;

    var propertyNames = context_v2_automationTrigger.Arguments.Properties.PropertyNames; // E.g. 'Body,Title', or 'Body'
    
    // Is there a body field we can adjust?
    if(propertyNames.indexOf('Body')>-1) {
        var bodyHtml = context_v2_automationTrigger.Arguments.Properties.Body;
        context_v2_automationTrigger.Arguments.Properties.Body = adjustMyLinks(bodyHtml);
    }