Thanks Cameron, that'll give me a good head start on this
next phase.
$burner->blaze_another() will be your friend when you
implement the
dependent story regeneration in your templates.
-----Original Message-----
From: cdmiller [mailto:cdmiller adams.edu]
Sent: Wednesday, October 31, 2007 3:34 PM
To: users lists.bricolage.cc
Subject: Re: NGA now using Bricolage
Almost forgot,
The RSS channel has an autohandler:
<?xml version="1.0"
encoding="utf-8"?>
<rss version="2.0">
<channel>
% $burner->chain_next;
</channel>
</rss>
- cameron
cdmiller wrote:
> Beaudet, David P. wrote:
>> Thanks! Nice to hear that.
>>
>> I'd love to get your RSS code. The next phase of
our Bric rollout is
>> most likely going to be to generate an RSS feed for
a regional
calendar
>> hosted by somebody else -- I'm trying to get them
to just consume a
feed
>> that we publish along with our calendar of events.
>>
>> And likewise, if you'd like any of my hacks, just
let me know. It's
>> going to be a bear to integrate some of them into
Bricolage, but
>> hopefully I'll get around to it this year, even if
it has to be at
night
>> after Ella
>> (http://farm3.static.flickr.com/2299/1705580537_31
518dcf7e_m.jpg) has
>> gone to bed
>>
>> - Dave
>>
> Hi Dave,
>
> Below is our template for our RSS output channel. We
have stories of
> type news item, great stories, and news archive page.
The news
archive
> page goes out and looks for all news items within it's
category. For
> the RSS channel it runs this glop of code and produces
the xml file.
> The archive page includes fields to limit the date
range and number of
> stories returned. It uses the Story-list to sort
descending by cover
> date. One of our outstanding to do items is modifying
the news item
and
> great stories templates to automatically republish
their news archive
> pages, much as you described for your events.
>
> Great picture of the little one, here's mine:
>
http://cameronmiller.net/pics/images/nic
ole_2006/october_sand_dunes/8x6d
scf0006.jpg
>
> <title><% $main_header %></title>
> <link><% $main_uri %></link>
> <description><% $main_header
%></description>
> %for my $doc ( docs) {
> % my $header =
$doc->get_element->get_data('header');
> % if (!$header) {
> % $header = $doc->get_title;
> % }
> % $header =~ s/&/&/;
> % $header =~ s/</</;
> % $header =~ s/>/>/;
> % my $slug = $doc->get_slug;
> % my $uri =
$burner->best_uri($doc)->as_string.$slug.'.php';
> % $uri = "http://".$domain.$uri;
> % my $date = $doc->get_cover_date("%a, %d %b
%Y %H:%M:%S %z");
> <item>
> <title><% $header %></title>
> <link><% $uri %></link>
> <pubDate><% $date %></pubDate>
> </item>
> %}
> <%init>
> my $main_header = $element->get_data('header');
> if (!$main_header) {
> $main_header = $story->get_title;
> }
> $main_header =~ s/&/&/;
> $main_header =~ s/</</;
> $main_header =~ s/>/>/;
> my $site_id = $story->get_site_id;
> my $site = Bric::Biz::Site->lookup({id =>
$site_id});
> my $domain = $site->get_domain_name;
> my $main_uri =
$burner->best_uri($story)->as_string;
> $main_uri = "http://".$domain.$main_uri;
> my $limit = $element->get_data('rss_headlines');
> my $cat_uri = $burner->get_cat->get_uri;
> my $types = ANY(qw(news_item great_story));
> my $start_date = '';
> my $end_date = '';
> $start_date = $element->get_data('date_start');
> $end_date = $element->get_data('date_end');
> my docs = Bric::Biz::Asset::Business::Story->list({
> unexpired => 1,
> site_id => $story->get_site_id,
> category_uri => "$cat_uri%",
> element_key_name => $types,
> Order => 'cover_date',
> OrderDirection => 'DESC',
> Limit => $limit,
> cover_date_start => $start_date,
> cover_date_end => $end_date,
> # Are we publishing?
> ( $burner->get_mode == PUBLISH_MODE
> ? (
> # Only return published articles.
> publish_status => '1',
> )
> : ()
> )
> });
> </%init>
|