Welcome to Squishdot Websites Squishdot How-To Newbies
 post article
 Mailing Lists
 Bug Tracking


Sticky Articles
How-To Posted by Bill on Monday August 18, 01:28PM, 2003
from the gimme some glue please dept.
Is there a "simple" way of allowing an article to stay on top of the list for an extended period of time? For example...even as new articles are posted, this "sticky" article stays at the top of the list sort of as Super Feature article that you want lots of attention drawn to.

<  |  >


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

    How to make Articles "Sticky"
    by Chris Withers on Friday August 22, 03:11PM, 2003
    ...without using Jam, Glue or Bodily Fluids!

    Go to the Article's edit page and put a Posting Date that's way in the future.

    Then tweak your SquishSite's index_html method to use a ZCatalog Search something like this:

    <dtml-in item_list>


    <dtml-in "this()(sort_on='date',

    So, the articles on the front page will be sorted in inverse order of date of posting, and because your article will have a date so far in the future, it'll stick at the top.

    In fact, twiddling carefully with these dates, you could even have several articles up the top that stayed in a set order.


    [ Reply to this ]
    • Re: How to make Articles "Sticky"
      by Bill on Sunday August 24, 05:23PM, 2003
      Go to the Article's edit page and Call me blind...but that I've never seen.
      [ Reply to this ]
      • You're blind...
        by Chris Withers on Thursday August 28, 03:41PM, 2003
        ...which would be the case if you've never seen.

        Not sure what it is you've never seen, but I'll take a guess...

        If you click on an article in the 'Postings' tab or click the 'edit' link next to one on the moderation tab, or append '/manage' or '/manage_editForm' to the article's URL, you'll get the edit form for the article.

        On newer versions of Squishdot, this page has a 'Date Posted' box where you can edit the date that appears as the Article's 'date' attribute.
        [ Reply to this ]
    • Re: How to make Articles "Sticky"
      by gif on Saturday September 11, 05:48PM, 2004
      This doesn't work after upgrading to Zope 2.7.2
      I'm getting this error:

      Traceback (innermost last):
      Module ZPublisher.Publish, line 101, in publish
      Module ZPublisher.mapply, line 88, in mapply
      Module ZPublisher.Publish, line 39, in call_object
      Module OFS.DTMLMethod, line 130, in __call__
      <DTMLMethod instance at edd0b680>
      URL: http://www.bek.no/BEKdot/index_html/manage_main
      Physical Path:/int/BEKdot/index_html
      Module DocumentTemplate.DT_String, line 474, in __call__
      Module DocumentTemplate.DT_In, line 626, in renderwob
      Module DocumentTemplate.DT_Util, line 198, in eval
      __traceback_info__: this
      Module <string>, line 1, in <expression>
      Module Products.Squishdot.SquishSite, line 836, in __call__
      Module Products.ZCatalog.ZCatalog, line 649, in searchResults
      Module Products.ZCatalog.Catalog, line 753, in searchResults
      Module Products.ZCatalog.Catalog, line 509, in search
      Module Products.ZCatalog.Catalog, line 577, in sortResults

      AttributeError: documentToKeyMap
      [ Reply to this ]
      • documentToKeyMap?
        by Chris Withers on Tuesday September 14, 11:00PM, 2004
        Is documentToKeyMap something that you've created?
        If not, how old is your SquishSite?

        I think the technique I described works just fine, but it appears your SquishSite's ZCatalog is having trouble...


        [ Reply to this ]
    Re: Sticky Articles
    by gif on Monday September 20, 10:36AM, 2004
    yes, it's strange. I can't find 'documentToKeyMap' anywhere!

    The Squishsite is a couple of years old. Is there any other way to rebuild/maintain it than using 'Re-catalog all postings'?
    [ Reply to this ]
    • Funny Index
      by Chris Withers on Tuesday September 21, 08:43PM, 2004
      The problem is that you have an index that doesn't have a method that ZCatalog is expecting it to have.

      Can you run through exactly what steps you took to upgrade the Zope instance which contained your SquishSite?
      [ 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.