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
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