Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2013
    Posts
    226

    Unanswered: Cover web address to hyperlink

    Hi,

    I'm a bit stumped with this. I have a text field which I export to a CSV file. If a web link is written in the text field I need this converted to a proper hyperlink when the record is exported to a CSV. Any ideas?

    Thanks

    Matty

  2. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    I would bet your link it's probably seen as just plain text when exported.

    You probably have to use the “search and replace” formatting functions to find any link in your text box, and replace them with a true hyper link.

    For example to create a link to this site, and have the link act and displayed as link, your text should look like this.

    Code:
    <a ref="http://www.dbforums.com">http://www.dbforums.com</a>
    You can use the search and replace formatting options to look for any text in your field that contains http. If it finds any, you use the formatting options and a variable to add the necessary additional html to make the link a the hyper link.

    Regards
    James

  3. #3
    Join Date
    Apr 2013
    Posts
    226
    Quote Originally Posted by Tubbritt View Post
    I would bet your link it's probably seen as just plain text when exported.

    You probably have to use the “search and replace” formatting functions to find any link in your text box, and replace them with a true hyper link.

    For example to create a link to this site, and have the link act and displayed as link, your text should look like this.

    Code:
    <a ref="http://www.dbforums.com">http://www.dbforums.com</a>

    You can use the search and replace formatting options to look for any text in your field that contains http. If it finds any, you use the formatting options and a variable to add the necessary additional html to make the link a the hyper link.

    Regards
    James
    Yep, but that's where I'm stuck as I can't see any way of using the formatting options to achieve what I need. The issue is that the link is just in a mass of other text, it isn't a field of it's own. I'm not sure about using a variable as part of the formatting options. Can you expand on that?

    As a workaround, I'm currently using a separate field for the link which I merge in on export using:

    <p><a href=""[PD_InfoLink1]"" target=""_new"">[PD_InfoLink1]</a></p>

    But that means I have to be quite rigid about where I refer to a link (i.e. always at the bottom of my main text field). So ideally I'd liked to be able to create the URLs on the fly.

    Cheers

    Matty

  4. #4
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Leave it with me and I will see if I can write this.

    Regards
    James

  5. #5
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    See attached file.

    I've typed in some text and a website address into the text box. Press the button “Find Link” on the form and the URL will be updated to a proper hyper link.

    Regards
    James
    Attached Files Attached Files

  6. #6
    Join Date
    Apr 2013
    Posts
    226
    Quote Originally Posted by Tubbritt View Post
    See attached file.

    I've typed in some text and a website address into the text box. Press the button “Find Link” on the form and the URL will be updated to a proper hyper link.

    Regards
    James
    Hi James,

    That's cool thanks. I would have to do that within a script though wouldn't I, so couldn't be done within the export template editor I'm guessing?

    Matty

  7. #7
    Join Date
    Apr 2013
    Posts
    226
    I guess there is also the question how to deal with multiple web addresses in the text box. This is a tricky one.

  8. #8
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    I would have to do that within a script though wouldn't I, so couldn't be done within the export template editor I'm guessing?
    See the line of code where I repopulate the text box. Use that to populate a variable instead of repopulating the text box.

    When creating your export template, use that new variable then instead of the text box.

    Regards
    James

  9. #9
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    I guess there is also the question how to deal with multiple web addresses in the text box. This is a tricky one.
    Every manually typed in http will always have a space before the first letter h where a proper hyper link won't after the script runs. So you can use the exact same code in a “goto” loop to keep scanning the text box until it has changed each website address and returns a found result of 0.

    Regards
    James.

  10. #10
    Join Date
    Apr 2013
    Posts
    226
    Quote Originally Posted by Tubbritt View Post
    See the line of code where I repopulate the text box. Use that to populate a variable instead of repopulating the text box.

    When creating your export template, use that new variable then instead of the text box.

    Regards
    James
    Right, yes I see. But I would have to initiate the script prior to that. I think the best thing to do is incorporate that into a dedicated export script - currently I just use the built-in export functionality.

  11. #11
    Join Date
    Apr 2013
    Posts
    226
    Quote Originally Posted by Tubbritt View Post
    Every manually typed in http will always have a space before the first letter h where a proper hyper link won't after the script runs. So you can use the exact same code in a “goto” loop to keep scanning the text box until it has changed each website address and returns a found result of 0.

    Regards
    James.
    Right, yes I'm with you. Thanks.

  12. #12
    Join Date
    Apr 2013
    Posts
    226
    ps, have had a fun day today with BD. For the first time discovered the charting tools available as special folders. Well impressed!

  13. #13
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    lol.... For me is addictive. Love Brilliant Database.
    Once you get your head around it, it's mighty powerful.

    James.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •