Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nik 1300 posts 5503 karma points MVP 3x c-trib
    Mar 12, 2018 @ 09:58
    Nik
    0

    Umbraco - Link configurations

    Hi All,

    I'd had a query raised by an SEO consultant and I'm unable to see a way to achieve what he is after.

    Basically, when rendering any outbound links they are after the option (ideally with a flag of some sort) to say if the link should have a "nofollow" rel tag added to it. Now, I could create a custom property editor but this wouldn't allow it to work in RTE's which is where most of the links exist.

    Has anyone had this requirement before and found a way to achieve it?

    Thanks,

    Nik

  • Lee Kelleher 3906 posts 14889 karma points MVP 10x admin c-trib
    Mar 12, 2018 @ 11:03
    Lee Kelleher
    1

    Hi Nik,

    I haven't had that requirement myself, but thinking about potential solutions.

    There's either the - take a sledgehammer to crack a nut, or a more granular approach.

    The sledgehammer one would be a custom HttpModule filter that would parse the response stream, figure out which links we external and modify the markup. Sounds full on, but it'd cover any gotchas.

    The granular approach would be to look at how the links are getting rendered. For things like content pickers (and other community property-editors), then those will be rendered in templates - so you control the markup.

    As for the RTE, as you say, it's problematic.

    For that I'd look at making a custom override for the RteMacroRenderingValueConverter value-converter. This is used to parse all the internal links/macros. You could override either the ConvertDataToSource or ConvertSourceToObject methods (important to remember to call the base methods), and add whatever custom code you'd need to add the "rel=nofollow" tags.

    Hope this helps?

    Cheers,
    - Lee

  • Nik 1300 posts 5503 karma points MVP 3x c-trib
    Mar 12, 2018 @ 11:49
    Nik
    0

    Cheers for the ideas Lee. Yeah for the content pickers/link pickers that aren't part of the RTE it's not to bad. Although what I'm ideally after is a checkbox for the editor to flag if the rel tag should be added or not on a per link basis.

    Now I could use nested content to wrap all these property editors but it feels like overkill in my opinion.

    I'm wondering if this is more something that should be looked as an improvement for the property editors (maybe a PR) where there are configurable options such as adding an anchor link or a query string to links, plus the option to add checkboxes for these sorts of things. Although we don't want to make the link pickers too complicated.

    I guess part of my question is also how many people have had this requirement?

    My initial thoughts are it sounds like a lot of work to work around existing implementations for something that might have a minimal impact especially when it's not for all external links but just some.

  • Lee Kelleher 3906 posts 14889 karma points MVP 10x admin c-trib
    Mar 12, 2018 @ 12:01
    Lee Kelleher
    0

    Gotcha. I'd expect many devs to make a site-wide assumption, e.g. external URL = "nofollow". But understand the need for granular control.

    I know what you mean with the property-editors, how to tackle adding more meta-data about the link itself, (e.g. many of the link pickers have a "open in new window" checkbox).

    NC would work, but yeah feels overkill - and wouldn't cover links in RTEs. Hmmm.

    Interested to hear if/how others have tackled this requirement too.

    Cheers,
    - Lee

  • Simon steed 357 posts 665 karma points
    Feb 10, 2020 @ 15:26
    Simon steed
    0

    Hi Guys - did you manage to come across a suitable solution for this? I've just had a requirement in asking to add nofollow but only to specific links the client chooses - at the moment i'm looking around to see how others have done it :-)

    Si

Please Sign in or register to post replies

Write your reply to:

Draft