• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF forum hyperlink

New Here ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

Hello,
New student to CF and would like to know how to turn a url in a CF forum comment to become a hyperlink?

Thank you
Monique

Views

371

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

Open the thread that has the post you want to link to, and click on the time of the post. The URL of that post will be copied onto the clipboard for you. (You may need to grant the browser permission to interact with your clipboard.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2021 Jun 13, 2021

Copy link to clipboard

Copied

Suppose you wish to create a hyperlink. The link's text is Adobe ColdFusion Forum.

 

Then 

1) Select the link text using your mouse:

 

link_text.png

 

 

2) Click on the chain-symbol ("Insert/edit link"):

chain_symbol.png

 

3) You will get a user-interface. Fill in the URL that corresponds to the link text, and press OK:

insert_link.png

 

The result is Adobe ColdFusion Forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 14, 2021 Jun 14, 2021

Copy link to clipboard

Copied

Thank you for your response.
Let me be more clear.  I am creating a very simple forum using Cold Fusion.  When users come and use the forum and post a message, and they type in a URL with their message, let's say at the end of a paragraph, I want the url to be a  hyperlink so that anyone reading the message just has to click on the link.  See the image below from a CF forum created by somebody else. 

CF_hyperlink.pngy.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 14, 2021 Jun 14, 2021

Copy link to clipboard

Copied

Ah. I shall assume you know how to extract the URL string from the forum message. You could use a regular-expression match to do so.

 

After that, simply use <a> tag in HTML.

 

Here is an example in which I embedded 2 URLs in the message:

 

 

<cfset forumMessage="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. https://www.google.com Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. https://community.adobe.com/t5/coldfusion/bd-p/coldfusion?page=1&sort=latest_replies&filter=all Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?">

<!--- I found the regular-expression at: https://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string --->
<cfset arrayOfUrlsInMessage = reMatchNoCase("(http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+##-]*[\w@?^=%&/~+##-])?",forumMessage)>

<!---<cfdump var="#arrayOfUrlsInMessage#" >--->

<cfif arrayLen(arrayOfUrlsInMessage) gt 0>
	Links in message: <br>
	<cfoutput>  	
		<cfloop index="i" from="1" to="#arrayLen(arrayOfUrlsInMessage)#">
			<a href="#arrayOfUrlsInMessage[i]#">#arrayOfUrlsInMessage[i]#</a> <br>
		</cfloop>	    
    </cfoutput>
</cfif>

 

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2021 Jun 17, 2021

Copy link to clipboard

Copied

@merlin8 , does that answer your question?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2021 Jul 04, 2021

Copy link to clipboard

Copied

LATEST

Hi Monique,

Could you give some feedback on our suggestions? Not only does it complete the discussion, your feedback will certainly help others.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation