Revision 296 (by ahitrov, 2013/03/26 17:59:01) Promosite (anthill) project source
<h2><% ref $section ? $section->name : 'NEWS' %></h2>

% foreach my $doc (@news) {
<p class="std"><% $doc->name %></p>
% }
<%args>

	$n	=> undef

</%args>
<%init>

  my $prj = $request->{project};
  my $profile = $request->{project_profile};
  my $root = $request->{project_section};
  $n = $n || $profile->newsblock_count || 5;
  my @news;
  my ($section) = $keeper->get_sections (
		s	=> $root->id,
		class	=> 'promosuite::NewsSection',
		status	=> 1,
		limit	=> 1,
	);
  return	unless	ref $section;
  @news = $keeper->get_documents (
		s	=> $section->id,
		class   => 'promosuite::News',
		status	=> 2,
		limit	=> $n,
		order	=> [qw|date direct|],
		light	=> 1,
	);

  return	unless @news;

</%init>