ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Truncate long URLs?

August 31, 2007 4:06am

Subscribe [3]
  • #1 / Aug 31, 2007 4:06am

    mapu

    7 posts

    Is there a possibility (or plugin) to truncate very long URLs which otherwise would crash the layout of a website?

    Like, out of

    <a href="http://domain.com/this-is-a-very-long-url/">http://domain.com/this-is-a-very-long-url/</a>

    make

    <a href="http://domain.com/this…url/">http://domain.com/this…url/</a>

    but pointing to the same destination, of course.

    Any limiter plugins will not work, because the URLs are within comments, not in a dedicated form field.

    Also, I don’t like any css solution that is just cutting the URL in the middle of a letter. It’s a matter of beauty 😉

    See this WP plugin as an example.

  • #2 / Aug 31, 2007 9:16am

    grantmx

    1439 posts

    From an SEO stand point, why on earth would you do that?  The search engine web crawlers not only crawl your content, but also crawl your URLs for relevant key words.

  • #3 / Aug 31, 2007 9:26am

    mapu

    7 posts

    From an SEO stand point, why on earth would you do that?  The search engine web crawlers not only crawl your content, but also crawl your URLs for relevant key words.

    I understand what you are trying to tell me, but I’m talking about URLs left by commenters in their comments, so I don’t care about the SEO’s point of view in this case :coolsmirk:

    Further, the link behind the URL should stay intact, of course.

  • #4 / Apr 24, 2008 11:57pm

    afarsh

    28 posts

    Just curious if anyone has found a solution for this yet?

    Commenters posting long urls is a major issue for us and we are still looking for a solution similar to what is mentioned here.

    Thanks in advance for any tips.

  • #5 / Apr 25, 2008 12:05am

    grantmx

    1439 posts

    You’ll likely have to create some sort of plug-in that scans the post for a url over a certain character limit, thus returning a truncated url.  Quite difficult I’d imagine.  The only other option is to provide a custom field for them to post URLs to, thus you could use the character limiter plug-in.

  • #6 / Apr 25, 2008 12:14am

    afarsh

    28 posts

    I’m really surprised that there is no plugin or other solutions available for EE. I’ve seen a lot of other platforms and forums handling this issue already just like how ‘Grad Student’ has suggested above in the first post.

  • #7 / Apr 25, 2008 12:28am

    afarsh

    28 posts

    Also see a related discussion here at another place on this forum.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases