Tags:
create new tag
view all tags

Question

I've tried the following. it seems that the variables are not expanded as i expect or I'm not writing the wiki code correctly. HELP!!!

%WEBLIST{"<li>[[$name.%HOMETOPIC%][%VAR{"SITEMAPWHAT" web=$name}%]]</li>" webs="public"}%

  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • Tech support for the TWiki collaboration platform.
  • %WEBLIST{"<li>[[$name.%HOMETOPIC%][$name.%SITEMAPWHAT%]]</li>" webs="public"}%
    

  • Blog.Tech support for the TWiki collaboration platform.
  • Codev.Tech support for the TWiki collaboration platform.
  • Main.Tech support for the TWiki collaboration platform.
  • Plugins.Tech support for the TWiki collaboration platform.
  • Sandbox.Tech support for the TWiki collaboration platform.
  • Support.Tech support for the TWiki collaboration platform.
  • TWiki.Tech support for the TWiki collaboration platform.
  • TWiki01.Tech support for the TWiki collaboration platform.
  • TWiki02.Tech support for the TWiki collaboration platform.
  • TWiki03.Tech support for the TWiki collaboration platform.
  • TWiki04.Tech support for the TWiki collaboration platform.
  • TWiki04x01.Tech support for the TWiki collaboration platform.
  • TWiki04x02.Tech support for the TWiki collaboration platform.
  • TWiki04x03.Tech support for the TWiki collaboration platform.
  • TWiki05x00.Tech support for the TWiki collaboration platform.
  • TWiki05x01.Tech support for the TWiki collaboration platform.
  • TWiki06x00.Tech support for the TWiki collaboration platform.
  • TWiki06x01.Tech support for the TWiki collaboration platform.
  • WikiWed.Tech support for the TWiki collaboration platform.
  • the last one looks to be the most promising.. but it picks up the last SITMAPWHAT for all iterations..

    Environment

    TWiki version: TWikiRelease02Sep2004
    TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
    Server OS: solaris
    Web server: apache
    Perl version: 5.005
    Client OS:  
    Web Browser: IE
    Categories:  

    -- StevenPokrandt - 13 May 2005

    Answer

    Steven - I spent a little time trying to figure out what the problem was but have not been successful (yet). I did figure out a couple of things:

    • In your second example, %SITEMAPWHAT% is being expanded expanded for the current web (i.e. Support), not the last web in the search.
    • To get SITEMAPWHAT for each web in the list, you'd need to use the VAR variable (like in your first example). However, I can't get that approach to work and don't know why. frown I tried using single quotes and "$qname" in VAR but no luck.

    I'll continue to explore this.

    -- LynnwoodBrown - 13 May 2005

    The reason why the first version does not work is that VAR is evaluated before WEBLIST. The solution is somewhat complex. It could be done with a SEARCH in a WEBLIST. Or with a CALC that iterates over the list of webs returned by WEBLIST:

    <ul>
    %CALC{$LISTJOIN($sp, $LISTMAP(<li>[[$item.%HOMETOPIC%][$item]]: $NOP(%)VAR{"SITEMAPWHAT" 
    web="$item"}$NOP(%)</li>, %WEBLIST{"$name" webs="public" separator=", " }%))}%
    </ul>
    

    There is a catch: The links in the SITEMAPWHAT do not get prefixed by the web name. This can be corrected by specifying a Web.TopicName link for each link in SITEMAPWHAT.

    -- PeterThoeny - 14 May 2005

    Or you could just do this:

    %WEBLIST{"   * [[$name.%HOMETOPIC%]]: %$markerVAR{\"SITEMAPWHAT\" web=$qname}$marker%" webs="public"}%
    

    -- SamHasler - 14 May 2005

    That is much easier Sam! Did not think of using $marker as a NOP.

    -- PeterThoeny - 14 May 2005

    I suppose I should confess that I copied the technique from TWiki.WebLeftBarWebsList which is included in all the WebLeftBars.

    -- SamHasler - 14 May 2005

    Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
    Topic revision: r7 - 2005-06-07 - PeterThoeny
     
    • Learn about TWiki  
    • Download TWiki
    This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
    Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.