Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

How to find and replace a URL in content

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
angplange - 14 Sep 2007 17:00 GMT
See this page:


http://democraticpartyofgeorgia.org/events/index.cfm?Fuseaction=Week&sm=9&sd=9&s
y=2007

It's pushing the margins way out because some people are typing in long URLs
in their event description (See the meeting on September 10). I'd like to be
able to parse the event descrip and replace that long url with a hyperlink
where the long url is in the href, but what is linked is something link "see
link". Is there any way to do that? I can search for the instance of "http://"
of course, but can't seem to figure out a way to tell where the link ends....
c_wigginton - 14 Sep 2007 21:15 GMT
Look at the ActivateURL udf at
http://www.cflib.org/udf.cfm/activateurl 

It's really more of a question on wrapping a really long word.  The URL isn't
wrapping and that is what is pushing out your margin.  You need the column to
wrap so that your column is a little more liquid.

Use the CF wrap() function.

<div id="breakwrap" style="width:150px;">

<cfoutput>#wrap("SamBrownbackRudyGiulianiMikeHuckabeeDuncanHunterJohnMcCainRonPa
ulMittRomneyTomTancredoFredDaltonThompson",25)#</cfoutput>
</div>

You can also go the CSS route, but the best solution I've found only works in
IE.
One method is to use CSS, the only problem is that it only works in IE

<div id="breakcss" style="width: 150px; word-wrap: break-word;">

SamBrownbackRudyGiulianiMikeHuckabeeDuncanHunterJohnMcCainRonPaulMittRomneyTomTa
ncredoFredDaltonThompson
</div>
angplange - 18 Sep 2007 20:35 GMT
The UDF worked perfectly, thanks (I just modified it to display "this link" instead of the URL)...

Thank you!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.