<% $id ? 'Все новости' : 'Новости' %>

% foreach my $doc (@news) { % if ($id && $id == $doc->id) {
<% $doc->name %>
% }else{ % } % } % if ($total > $n) {
Страница <& /inc/pages_.msn, total => $total, n => $n, p => $p &>
% }
<%args> $n => 20 $p => 1 $id => undef <%init> my $prj = $request->{project}; my $profile = $request->{project_profile}; my $root = $request->{project_section}; my ($section) = $keeper->get_sections ( s => $root->id, class => 'promosuite::NewsSection', status => 1, limit => 1, ); return unless ref $section; my $total = $keeper->get_documents ( s => $section->id, # class => 'promosuite::Article', class => 'promosuite::News', status => [1,2], count => 1, ); my @news = $keeper->get_documents ( s => $section->id, # class => 'promosuite::Article', class => 'promosuite::News', status => [1,2], limit => $n, offset => $n*($p-1), order => [qw|date direct|], light => 1, ); return unless @news;