> Forums > Active Forums > Community Support > Hyperlinks in a post not automatically linking.
Last Post 28 Nov 2011 04:04 PM by John Henley. 10 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Jeff
Registered Users
Jeff
Post Count:5

--
18 Jul 2011 04:42 PM
    • Active Forums Version: 4.3.5
    • DotNetNuke Version: 5.2.0
    I'd like for the links in message posts to be active once the post is made and I have the option "Enable Automatic Hyperlinks" in the control panel set to "Yes" but unless you add the "http:\\" in front of the www the link is not active. How can i fix this? We are using Active Forums 4.3.5.0 Enterprise Edition. Thanks for the help!
    Jeff
    Registered Users
    Jeff
    Post Count:5

    --
    19 Jul 2011 02:28 PM
    Anyone? I used the filter to add "http://" in front of the "www" when it appears but if you edit the post, the filter applies again so you then get "http://http://" and voids the link. Is there anyway to tell the filter using regex to only apply the filter on the "www" if there is either a space or no other characters in front of it?
    Ben - DotNetNuke
    DotNetNuke Staff
    Ben - DotNetNuke
    Post Count:1644

    --
    19 Jul 2011 03:48 PM
    Here you go:

    Text to find: (^| )www
    Replacement: http://www
    Filter Type: Regular Expression

    Note: There is an extra leading space on the replacement.
    Jeff
    Registered Users
    Jeff
    Post Count:5

    --
    19 Jul 2011 04:17 PM

    Posted By Ben on 19 Jul 2011 04:48 PM
    Here you go:

    Text to find: (^| )www
    Replacement: http://www
    Filter Type: Regular Expression

    Note: There is an extra leading space on the replacement.


    That didn't work: (^| )www

    This did but ONLY only the first link in the post. any subsequent links don't get filtered: (^| +www)

    I also tried: (/s+www) and while this works on all links, it takes the link and butts it up next to the word that is before it (or the last word in the line above the link if the link is on a line by itself). I need to be able to tell the "replacement" field to keep the text where it is at (i.e. on the same line by itself or in between text, etc...)

    Hopefully this makes sense. Here is some examples of what I mean:

    www.google.com (On a line by itself)

    This is text before the link: www.google.com and this is text after it (notice the text before and after the link? The link needs to stay in between the text.)

    www.google.com

    www.google.com
    (notice the 2 links on seperate lines right after each other?)

    Thanks.
    Jeff

    (Notice the links are right after each other on different lines?
    Jeff
    Registered Users
    Jeff
    Post Count:5

    --
    20 Jul 2011 02:22 PM
    Anyone else got any ideas? I'm still stumped!
    Jeff
    Registered Users
    Jeff
    Post Count:5

    --
    21 Jul 2011 12:25 PM
    Ok, so I figured out something else that 'kinda' works... You put in two different filters:

    1.
    Text to find: ( www)
    Replace with: http://www" target="_blank" rel="nofollow">http://www

    This one finds a link with a space before it (Notice the space before the www in "text to find"). Basically this looks for inline links (Links that are not on a line by themselves) and replaces the "www" with "http://www" target="_blank" rel="nofollow">http://www" which then in turn makes the link automatically active.

    2.
    Text to find: (\s+www)
    Replace with:
    <br><br>http://www" target="_blank" rel="nofollow">http://www


    This one finds link text that starts on a line of it's own and replaces the "www" with "http://www" target="_blank" rel="nofollow">http://www" and makes the link automatically active. The problem with this one is that it changes the formatting of the post because of the multiple line breaks (fyi, using a single line break also changes the formatting of the post). If you don't include the br tag's the link text will be butted right up against the the character that precedes the link no matter what line it's on so you get a run on word (i.e. jeffhttp://www" target="_blank" rel="nofollow">http://www.google.com instead of http://www" target="_blank" rel="nofollow">http://www.google.com being on a line of it's own)

    When you first make the post, the filters above work correctly (other than the slight formatting issues with the second filter's line breaks. The problems occur once you start editing the post. What I have found is that you can edit the post no more than 3 times without it messing up the links otherwise your links become de-activated. The reason behind this is that when you go in and edit the post, for whatever reason DNN adds a space before and after each line. I haven't figured out why it does this but it doesn't actually affect the formatting of the post once click the submit button. The only problem is, the spaces stay there in the post when you re-edit so it keeps adding spaces before and after each line each time you edit the post, so after 5 edits, you get five spaces before and after each line for some weird reason. Once you remove the spaces upon an edit, your links go back to be automatically active.

    I still want to find a correct and permanent fix to this problem (or see the DNN people address this so we don't have to use filters to get this to work).

    Jeff
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7672

    --
    21 Jul 2011 03:02 PM
    Hi Jeff,
    The current functionality is what we support and what we will continue to use. We have to support various input methods and filters which is why we allow you to toggle the automatic hyperlinks feature. There are many different scenarios that we need to consider which is why the regex approach is your best option. You can come up with a regex filter that meets your configuration needs. We had this capability at one time, but it was causing problems for different configurations. I wish could give you the perfect solution, but if we could, it would be in the product already.

    Thanks,
    Will
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    Jeff
    Registered Users
    Jeff
    Post Count:5

    --
    21 Jul 2011 04:50 PM

    Just curiously, why do spaces get put before and after a line when you edit a post? It doesn't change the formatting of the post once you click the submit button but each time you click the edit button and submit the changes, a space before and after each line is added. This is what is messing with my filters as far as I can tell.



    Posted By Will Morgenweck on 21 Jul 2011 04:02 PM
    Hi Jeff,
    The current functionality is what we support and what we will continue to use. We have to support various input methods and filters which is why we allow you to toggle the automatic hyperlinks feature. There are many different scenarios that we need to consider which is why the regex approach is your best option. You can come up with a regex filter that meets your configuration needs. We had this capability at one time, but it was causing problems for different configurations. I wish could give you the perfect solution, but if we could, it would be in the product already.

    Thanks,
    Will

    John Henley
    Customers
    John Henley
    Post Count:408

    --
    28 Nov 2011 10:20 AM
    Can anyone provide guidance on how/where this is configured.
    I have similar issue with 'automatic hyperlinks' being created incorrectly if the hostname is not www, e.g.

    http://agency.governmentjobs.com/sa...efault.cfm
    is rendered as:

    Ben - DotNetNuke
    DotNetNuke Staff
    Ben - DotNetNuke
    Post Count:1644

    --
    28 Nov 2011 03:35 PM
    What version of the module are you using, and what html editor? As you can see the first link was rendered correctly here, and it works on my localhost.
    John Henley
    Customers
    John Henley
    Post Count:408

    --
    28 Nov 2011 04:04 PM
    AF 4.3.6
    Using the Telerik editor.
    You are not authorized to post a reply.
    > Forums > Active Forums > Community Support > Hyperlinks in a post not automatically linking.
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy