Welcome to Squishdot Websites Squishdot How-To
 about
 search
 post article
 Documentation
 Mailing Lists
 Bug Tracking
 Development
 Installation
 Upgrading
 Download
 admin
 rdf

 main


Permanent name aliases for postings?
Squishdot Posted by anser on Sunday January 23, 11:59PM, 2000
from the my-good-name-outlives-me dept.
Butch, how would you suggest going about the following: I want to be able to assign certain threads or postings a "nickname" or permanent alphanumeric URL path, so that others can bookmark it and go straight to that thread or posting when they come to the Squishdot site. Details in main body.

For example, suppose a particular posting/thread (that received the arbitrary id 217349205) contains a bunch of perfect recipes for Moroccan stew, and I want to give cooking magazines a link, without ripping out the posting and stuffing it into a hand-built Zope folder or method. But I don't want to give them the link mysite.org/217349205/ because they'll get it wrong, and/or I will rebuild my database and the number will change. Instead, I'd like to give them mysite.org/stew . Now, I could install the Zope Redirector product and create a Redirector named 'stew' that redirected to 217349205, but this has two problems. One, people will see the redirect and end up bookmarking 217349205 and passing it around anyway, with the same problems; two, if I rebuild the database, the Redirector doesn't follow. On the other hand, I could easily hack Squishdot.py to add a "nickname" attribute to postings, editable via editPosting, and this would survive rebuilds and everything else. But I don't know how to make sure that HTTP requests for /stew/ would get mapped invisibly to /217349205/. How would you go about this?

<  |  >

 

Related Links
  • Articles on Squishdot
  • Also by anser
  • Contact author
  • The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Re: Permanent name aliases for postings?
    by Butch Landingin on Monday January 24, 10:19PM, 2000
    Here's what I tried just a few minutes ago...

    I created a DTML method named permanentAlias.

    This is the body of the dtml method:

    <dtml-with "this()['948671987']">
    <dtml-var posting_html>
    </dtml-with>
    Note: '948671987' is the id of the article when it was posted and is hard-coded into the dtml method.

    Result: the dtml method executes the posting_html method of the item and displays the article text
    under a new, easier-to-remember URL.

    Of course, the applicability of this is dependent on how many of these easier-to-remember urls you want to create. Also, if you regenerate your database and the ids change,you'd have to edit the DTML method because the id is hardcoded into it..

    If you do want to create a lot of these easier to remember urls, you might think about encapsulating this behavior in a ZClass/python class etc... and doing something that will allow you to associate the url with object... etc...

    HTH.

    --Butch
    [ Reply to this ]
    How bout keywords?
    by Paul Everitt on Sunday January 30, 02:49PM, 2000
    Ahh, finally getting a chance to plug into the Squishdot community!
    We're pretty excited about working with all of you, even if it means I
    have to re-read Butch's RFC 20 times trying to understand it. :^)

    Concerning this matter. These days I seem to see all of Zope through
    the catalog, so I'll apply a catalog answer to it.

    The ZCatalog has a rather unknown ability to do "keywords". That is,
    a property can be a list of words and then a keyword index can be
    applied to it.

    What if you could add a keyword to a post (either let the user do it
    or the administrator could do it), then refer to
    www.my.site/SomeSquish/Keywords/stew as the permanent URL? If the
    search only turns up one result, it is displayed. Otherwise, the
    matches are displayed.

    Since the keyword metadata is independent of the object id, *and* it
    doesn't pollute the body content, this system should work ok, no?
    [ Reply to this ]
    • Re: How bout keywords?
      by Michael Bernstein on Wednesday February 02, 04:23AM, 2000
      Hi Paul, glad you could join us.

      I assume from your example that /Keywords is a ZCatalog, yes?

      If so, does the ZCatalog support specifiying multiple keywords through a URL?

      [ Reply to this ]

     
    The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Powered by Zope  Squishdot Powered
      "Any system that depends on reliability is unreliable." -- Nogg's Postulate
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©1999 Butch Landingin, ©2000-2002 Chris Withers.