This question about Topic Markup Language and applications: Answered

FoswikiSiteSkin Dynamic Web Bar

Creating a dynamic toolbar of webs using the FoswikiSiteSkin

First, let me say that this is a great project and kudos to the community for improving on this wiki. I am using the FoswikiSiteSkin and have successfully statically customized it for the 1/2 dozen or so web I am using. It would be great, however, if I could dynamically generate the top toolbar of webs based on the list of available webs a user has access to once they have logged in. Anyone have any suggestions as to how to implement this in the templates?

Solutions

If you install the ForEachPlugin you can use the following code to implement this in the FoswikiSiteSkinNavigationTemplate page.

   %FOREACH{"web" in="%WEBS%"}%
   %TMPL:P{"topbarbutton" ID="" DESTWEB="$web" DESTTOPIC="WebHome" LABEL="$web"}%
   %NEXT{"web"}%

With Foswiki 1.0.6 I could not find %WEBS% macro, so had to use %WEBLIST{$name,}% to get it to work correctly (though now the active tab does not stay highlighted)
%FOREACH{"web" in="%WEBLIST{$name,}%"}%
%TMPL:P{"topbarbutton" ID="" DESTWEB="$web" DESTTOPIC="WebHome" LABEL="$web"}%
%NEXT{"web"}%

QuestionForm edit

Subject Topic Markup Language and applications
Extension FoswikiSiteSkin
Version
Status Answered
Topic revision: r4 - 01 Jul 2010, StevenKrahn
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy