List Info

Thread: Re: NGA now using Bricolage




Re: NGA now using Bricolage
user name
2007-10-31 14:18:17
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/nicole_2006/october_sand_dunes/8x6dscf0006.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/&/&amp;/;
%    $header =~ s/</&lt;/;
%    $header =~ s/>/&gt;/;
%    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/&/&amp;/;
$main_header =~ s/</&lt;/;
$main_header =~ s/>/&gt;/;
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>

Re: NGA now using Bricolage
user name
2007-10-31 14:34:21
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/nicole_2006/october_sand_dunes/8x6dscf0006.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/&/&amp;/;
> %    $header =~ s/</&lt;/;
> %    $header =~ s/>/&gt;/;
> %    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/&/&amp;/;
> $main_header =~ s/</&lt;/;
> $main_header =~ s/>/&gt;/;
> 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>

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )