Tags:
create new tag
, view all tags

Question

If I have a subweb, e.g. Projects/Ruby/Code what is the best practice recommended way to get the name of the subweb?

%WEB% returns the entire path. Not what I want.

I'd love a %WEBPATH% variable that returns the path and %WEB% to return only the current web (subweb) name, but until that exists,... is %CALC... the best bet?

Subweb is %CALC{"$SUBSTITUTE(%WEB%,^.*/,,,r)"}%
seems to work. Is there something "better"?

And while I'm at it, is there something I can do to fix the breadcrumbs to show the path elements separately? Short of editing the code? smile

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- VickiBrown - 30 Mar 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Try %FLEXWEBLIST{webs="%WEB%" format="$name"}% using FlexWebListPlugin. There's probably a similar approach using the BreadCrumbsPlugin

-- MichaelDaum - 30 Mar 2008

And while I'm at it, is there something I can do to fix the breadcrumbs to show the path elements separately? for now your only solution is to use the BreadCrumbsPlugin. But this is on my TODO list at ExplodeHierarchalWebsInBreadcrumbs so it may happen in the core someday smile

-- ColasNahaboo - 31 Mar 2008

To take Michael's suggestion one step further, you could also set a site-wide preference variable in TWikiPreferences like "Set SHORTWEB = %FLEXWEBLIST...", which would allow you to quickly substitute in the shorter web name. I'm using this in the left bar and it seems to work well.

-- GarySprague - 30 Jul 2008

 
Change status to:
Topic revision: r4 - 2008-07-30 - GarySprague
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.