jmevius
Nov 28 2003, 12:58 PM
Is there a way to trim an incoming url in the MTCommentBody tag? Currently, if someone leaves a url in my comments, it is autolinked. If the url is long like:
http://this.is.a/really_long_url/with_many...t_want_that.phpI would like to break it to the first 40 characters, plus a few periods, like so:
http://this.is.a/really_long_url/with_ma..
Any ideas? I would still want it linked to the original (long) destination.
On preview: It appears that the forum software itself knows how.
medic119
Nov 28 2003, 03:11 PM
Not that I know of, but there are tag to trim excerpts etc.
Try the remove_html="1" tag to turn the URL into a text link. It will remove the url from the link text leaving just the text behind. I use it in my "recent Comments."
The other tag is Trim_to="xx" where xx is a numeral. That will trim excerpts to whatever length you want.
In my Recent comments I use trim_to="50" to trim the comment excerpts to only 50 characters.
The code would look something like
<MTCommentBody trim_to="50" remove_html="1">
Don't know if thats exactly what you are lookign for, but its the best answer I have using the built in MT functions.
jmevius
Dec 9 2003, 02:20 PM
Thanks for everyone who wrote in suggestions.
This is the anwer I was dying for the whole time.
girlie
Dec 9 2003, 04:18 PM
Which is the topic I referenced in my entry linked above.
jmevius
Dec 9 2003, 06:54 PM
Sorry. I misinterpreted your writeup as saying it would extract the page title, kinda like link title capability.
Thanks.