
dawn at dawnthots
Jun 22, 2011, 9:28 AM
Post #4 of 5
(527 views)
Permalink
|
thanks you guys.. I actually DID try that first but it didn't seem to be working.. so I thought me code was flawed. But it was late.. and now I will try it again in the clear light of day. Dawn On 2011-06-22, at 11:56 AM, Bret Dawson wrote: > Hi Dawn, > > How about this? > > > my ($next) = $story->list({ > element_key_name => 'article', > category_id => $story->get_primary_category->get_id, > unexpired => 1, > publish_status => 1, > limit => 1, > exclude_id => $story->get_id, > cover_date_start => $story->get_cover_date, > Order => 'cover_date', > OrderDirection => 'ASC', > }); > > > > my ($prev) = $story->list({ > element_key_name => 'article', > category_id => $story->get_primary_category->get_id, > unexpired => 1, > publish_status => 1, > limit => 1, > exclude_id => $story->get_id, > cover_date_end => $story->get_cover_date, > Order => 'cover_date', > OrderDirection => 'DESC', > }); > > > > On Wed, 2011-06-22 at 11:47 -0400, Dawn Buie wrote: >> Hi all >> >> I think I figured this nav puzzle out on a project many years ago but can't find my old code. >> >> I want to make next and prev nav links in a blog story that would link to the previous story in the same category - ordered by cover date. There's not a way to use story->list() and Offset => -1 is there? If so it doesn't seem to be working for me. >> >> here's what I have in the Blog story: >> >> >> my ($next) = $story->list({ >> element_key_name => 'article', >> category_id => $story->get_primary_category->get_id, >> unexpired => 1, >> publish_status => 1, >> limit => 1, >> exclude_id => $story->get_id, >> cover_date_start => $story->get_cover_date, >> Order => 'cover_date', >> OrderDirection => 'DESC', >> }); >> >> >> >> my ($prev) = $story->list({ >> element_key_name => 'article', >> category_id => $story->get_primary_category->get_id, >> unexpired => 1, >> publish_status => 1, >> limit => 1, >> offset => -1, >> exclude_id => $story->get_id, >> cover_date_start => $story->get_cover_date, >> Order => 'cover_date', >> OrderDirection => 'ASC', >> }); >> >> thanks >> Dawn >> >> >> > > -- > Bret Dawson > Producer > Pectopah Productions Inc. > (416) 895-7635 > bret [at] pectopah > www.pectopah.com >
|