Feb 15, 2010, 8:53 AM
Post #6 of 14
(5445 views)
Permalink
Hi Zdravko,
That "needs publish" marker indicates that the current version of the
story is ahead of the published version. Something like this:
Story was published shortly after creation. Published version is #1.
Next, story was edited, then checked in. Current version is #2, but
published version is #1. In a case like this, the P will turn red.
This is different from a cover needing to be published. If you have
published a bunch of stories and want them to show up on the home page,
that won't do anything to the home page's P.
The way I've dealt with this recently is to make two utility templates.
The first one is called "index_publisher." Most stories call this one in
a <%cleanup> block. It looks at the story type and categories of the
story that called it, and it uses that to come up with a list of urgent
covers, and then it publishes those covers.
The second is called "archive_index_publisher," and is used for covers
that are not so urgent and can go three minutes or so between updates.
A very simple story called "Index trigger" is republished (via cron) by
bric_republish every three minutes, and this calls the utility template.
The template itself begins by looking up all the stories published in
the last hour. Then it runs through that list of stories, and for each
one, it figures out what sorts of covers ought to be triggered. Then it
does a story->list() for the covers that have publish dates earlier than
the publish date of the current story. If it finds any, it adds them to
an array of @covers_to_publish.
Then, in a <%cleanup> block, it calls publish_another() on each story in
@covers_to_publish.
I'd be happy to share the code, if that would help, although the mix of
story types and categories will probably be quite different from the
ones on your site. But let me know.
Cheers,
Bret
On Mon, 2010-02-15 at 13:56 +0100, Zdravko Balorda wrote:
> Simon Wilcox wrote:
> >
> > That's not quite the same thing. That will publish the cover story at
> > the same time the story is published but that's not always what you want.
> >
> > It would be useful if you could flag another story to be re-published
> > later. That could then be flagged by several stories in a time period
> > but only re-published once.
> >
> > In a complex site with heavy dependency chains I could see how that
> > would save a lot of repeated and mostly redundant publications of cover
> > pages.
> >
>
> Exactly my point.
> I am considering cron publishing all cover stories periodicaly. Every
> 15min or so, on all sites.
> There is already "needs publish" red P marker. Any way to wave this flag
> from story template? bric_dist_mon could schedule publishing, then.
>
> Zdravko
>
--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret@pectopah.com
www.pectopah.com