Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Better Section List Boxes
By tneff , Section Code []
Posted on Wed May 08, 2002 at 12:00:00 PM PST
One thing I didn't like about the default Scoop distribution was that the section links in the header (block section_links) was just a hard-coded list of HREF's that you have to remember to edit every time you add, remove or change a section -- and it stays static for every visitor, regardless of whether they have the privilege to see all the sections listed. So I fixed it...

I wrote a box called section_list (using template empty_box) as follows:
my @sections = @{$S->get_sections()};

sub make_sec_href($$) {
  my ($sec,$title) = @_;
  my $href = "|rootdir|";
  $href .= "/section/$sec" if $sec;
  return "<a href=\"$href\">$title</a>";
}

my @links = ( make_sec_href("", "Home"),
	      make_sec_href("__all__", "Everything") );

for my $s (@sections) {
  if ($S->have_section_perm('norm_read_stories', $s)) {
    push @links, make_sec_href($s, $S->{SECTION_DATA}->{$s}->{title});
  }
}

my $content = join(' · ',@links);

return {'content'=>$content};
Then I modified the section_links block to say:
|norm_font|  
  |BOX,section_list|
|norm_font_end|
Now I can have 'backroom' sections for editors or admins, as well as stuff that's only visible to logged-in users, and the list of links on each page is adjusted accordingly.
< Edit Queue? | Rio de Janeiro, Brazil >

Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Login
Make a new account
Username:
Password:

Related Links
· Scoop
· More on Boxes
· Also by tneff

Story Views
  42 Scoop users have viewed this story.

Display: Sort:
Better Section List | 3 comments (3 topical, 0 hidden)
sounds great! (none / 0) (#1)
by skloogs on Thu May 09, 2002 at 07:37:38 AM PST

I didn't installed scoop a long time ago, but I was just thinking the same when I noticed that changing the title of a section was not reflected directly on the section bar... then I realized I had to update manually the section_links block...

A great contribution I will try and adapt at once...

Thanks!

phil.

---
Phil
[ A Brazilian Scoop ]



Check Cashing Carson (none / 0) (#2)
by Pervez on Sun Apr 08, 2018 at 08:24:52 PM PST

World of war craft extremely impressive webpage. My organization is extremely astounded to read the paper them. I absolutely have substantially material the site. All this report is generally needful together with carried out overly. These days see some of our web-site Check Cashing Carson Thank you so much considerably meant for model material.



General Contractor City of Yonkers (none / 0) (#3)
by Pervez on Sun Mar 24, 2019 at 02:34:13 PM PST

Excellent weblog post relating to this subject. I've been recently inside your weblog a couple of times right now. I simply desired to state hello as well as display my personal many thanks for that info many thanks. Right now, click the General Contractor City of Yonkers Many thanks with regard to good info.



Better Section List | 3 comments (3 topical, 0 hidden)
Display: Sort:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search