Tags:
create new tag
view all tags

Question

my simple test of TopicVarsPlugin is that it works a little, ie., it seems to render properly in "preview", but not in the standard view.

btw, i have the ConditionalPlugin installed as well, which is modified per Peter Thoeny's suggestion to fix multiple line support for if/else/endif (see below).

here's my page :


   * set this TopicVarsPlugin variable
      * Set SAE_LEVEL = 3

SAE_LEVEL is %SAE_LEVEL%
SAE_LEVEL is [%SAE_LEVEL%]

%IF{ %SAE_LEVEL% eq 2 }% yes 3 is equal to 2.%ELSE% no, 3 is not equal to 2. %ENDIF%

---------------------------------------------------

i get this output in "Preview Changes", which is correct :



    *  set this TopicVarsPlugin? variable
          o Set SAE_LEVEL = 3

SAE_LEVEL is 3 SAE_LEVEL is [3]

no, 3 is not equal to 2. 

------------------------------------------------

after "save changes" i get this output, which does not
properly render  :

    *  set this TopicVarsPlugin? variable
          o Set SAE_LEVEL = 3

SAE_LEVEL is 3 SAE_LEVEL is [3]

%IF{ 3 eq 2 }% yes 3 is equal to 2.%ELSE% no, 3 is not equal to 2. %ENDIF% 

----------------------------------------------------------------------------

This is the communication with Peter Thoeny regarding the ConditionalText multiple
line issue :



Date: Tue, 14 Jan 2003 22:43:23 -0800
From: Peter Thoeny 

<..skipped text..>

I have not tried out this Plugin. Looking at the
source, it is coded to work only on one line.
To span multiple lines you need to add a 's' switch
to the regex in sub commonTagsHandler. 

Change from:
    $_[0] =~ s/$prefixPattern$condPattern_ifelse.../.../geo;
    $_[0] =~ s/$prefixPattern$condPattern_ifonly.../.../geos;
To:
    $_[0] =~ s/$prefixPattern$condPattern_ifelse.../.../geos;
    $_[0] =~ s/$prefixPattern$condPattern_ifonly.../.../geos;

Regards,
Peter


> 
> peter,
> we have been making some headway in getting to
> know TWiki. One of our big requirements is
> conditional text, so i have been playing with
> the ConditionalPlugin today, but found some problems
> with it, and unfortunately my mail to Jeroen bounced.
> 
> would you have any ideas ?
> 
>         Jeroen,
>         i have been trying to use the ConditionalPlugin. I have
>         success on simple constructs where the if/then/else clauses
>         ALL occure on one line, but it fails when seperated by
>         <cr>
> 
>         i am trying to use this stuff to conditionally block out
>         several lines of text (dependending on some access controls).
> 
>         any advice ? is it easy to fix ?
> 
>         /rustagi



  • TWiki version: (from bottom of WebHome) : Revision r1.16 - 24 Nov 2001 - 11:35 GMT
  • Perl version: version 5.005_03 built for sun4-solaris
  • Web server & version: apache2.0
  • Server OS: SunOS valiant2 5.8 Generic_108528-16 sun4u sparc SUNW,Ultra-5_10
  • Web browser & version: Netscape 7.0
  • Client OS: SunOS valiant2 5.8 Generic_108528-16 sun4u sparc SUNW,Ultra-5_10

-- PcRustagi - 16 Jan 2003

Answer

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2003-04-30 - 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.