SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru mdumka's Avatar
    Join Date
    Jul 2003
    Location
    True North
    Posts
    642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    URL Wraping just like Google

    Hello ...

    I am working on a project that has search functionality. Everything works great but the client wants the URL's of the pages displayed in the search results just like Google.

    The problem I am having is I can not figure out their logic on where to break and where not to ... has anyone tried to come up with a similar solution ... I could sure use a push in the right direction.

    Thanks

    Mike

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mdumka View Post
    the client wants the URL's of the pages displayed in the search results just like Google.

    The problem I am having is I can not figure out their logic on where to break and where not to
    Unless you're using AJAX to update the page, this looks like a server-side problem.
    It looks like they break at the space or '/' closest to the desired wrapping point. Just find that character and insert a break at that point. If there is no such character say within half the desired display width, break at the wrapping point regardless. Repeat as many times as necessary.
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Guru mdumka's Avatar
    Join Date
    Jul 2003
    Location
    True North
    Posts
    642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Logic ... I have a script that breaks at a desired wrapping point but was looking to see if anyone had figured out the logic for wrapping at the '/' because that is what I am having trouble with.

    Have a good one ...

  4. #4
    SitePoint Zealot
    Join Date
    Sep 2007
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doesn't it break on '/' by default in your browser?


Bookmarks

Posting Permissions

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