Description:
This box allows a section to be displayed through its own op, allowing sections to have their own templates.
Box Code:
# For this to be useful, create a new op with the same name as your section. The make your new op call this box, and the op will make the section look just like |rootdir|/section/foo -- except that now you can assign a custom template to it if you wish.
my $section = $ARGS[0];
$S->param->{section} = $section;
$S->{UI}->{BLOCKS}->{subtitle} = $S->{SECTION_DATA}->{$section}->{title};
if( $S->have_section_perm('hide_read_stories', $S->cgi->param('section')) ) {
$S->{UI}->{BLOCKS}->{subtitle} = '';
}
$S->{UI}->{BLOCKS}->{CONTENT} = $S->frontpage_view('section');
return;
|