Tags:
create new tag
view all tags

Question

I have a list, stored in a variable. It is like "Web1.Topic, Web2.Topic" - i.e. both topics have the same name. Can I use RenderListPlugin for this? (I want it to show the web names).

If not, is there anything you can suggest? Thanks.

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, SpreadSheetPlugin and others
Server OS: N/A
Web server: N/A
Perl version: N/A
Client OS: N/A
Web Browser: N/A

-- MartinCleaver - 02 Mar 2004

Answer

I don't exactly understand your question. Stored in what kind of variable? Do you want to convert the comma delimited list into bullets, to be rendered by this Plugin? In this case you can use a $SUBSTITUTE() to replace all ", " into bullets.

-- PeterThoeny - 04 Mar 2004

Ok, I know understand (from http://koala.ilog.fr/twikiirc/bin/irclogger_log/twiki?date=2004-03-04,Thu&sel=34#l30) what the difference between the variable types are. I mean a variable defined in TWikiPreferences.

I appreciate my question was unclear. I want to render a variable WEBCALS = "Web1.Topic, Web2.Topic" so that each element of the variable is rendered including the web name. http://koala.ilog.fr/twikiirc/bin/irclogger_log/twiki?date=2004-03-02,Tue&sel=10#l6 has an example.

Can RenderListPlugin help me there?

Thanks, M.

-- MartinCleaver - 04 Mar 2004

(question moved to here from Plugins.RenderListPluginDev)

Oh, I see. If you write Web.TopicName you will get a link text of just TopicName. To show also the name of the web, write [[Web.TopicName]]. Use SpreadSheetPlugin's $SUBSTITUTE() function to convert all Web.TopicNames in a list into the square bracket links. Unfortunately commas are not supported. Here is an example with + delimited topics: (the example escapes the double brackets with <nop> so that you can see the result; remove the escape when using it)

  • Set TESTVAR1 = Web1.Topic1+Web2.Topic2+Web3.Topic3
  • You type: %CALC{[[$SUBSTITUTE(%TESTVAR1%,+,]] [[)]]}%
  • You get: [[Web1.Topic1]] [[Web2.Topic2]] [[Web3.Topic3]]

You can go fancy and nest some functions to convert a comma separated list: (first translate the comma into semicolon, then substitue, then convert semicolon back to comma)

  • Set TESTVAR2 = Web1.Topic1, Web2.Topic2, Web3.Topic3
  • You type: %CALC{[[$TRANSLATE($SUBSTITUTE($TRANSLATE(%TESTVAR2%,$comma,;),; ,]]; [[),;,$comma,)]]}%
  • You get: [[Web1.Topic1]], [[Web2.Topic2]], [[Web3.Topic3]]

-- PeterThoeny - 04 Mar 2004

Thanks Peter. I guess that spreadsheet plugin really has a much broader scope than spreadsheets.

It is a shame about the non-support for commas - the workaround really makes the expression ugly and unintuitive for a new administrator, especially if I had to use it more than once. Hence, I'm hestitant to use your solution as I am sure it would just freak out whoever took over the web.

-- MartinCleaver - 05 Mar 2004

You could contribute a $FUNC("parser", "with", "parameters in double quotes") if you want commas retained in text wink

-- PeterThoeny - 05 Mar 2004

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2004-03-06 - 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-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.