Forum OpenACS Development: Re: conditional property

Collapse
3: Re: conditional property (response to 1)
Posted by Bart Teeuwisse on

Actually, there is a clean third way of doing this.

  1. Create an new .adp file. Let's call it headerstuff.adp containing:
    
    <if @condition_1@>Item 1</if>
    <if @condition_2@>Item 2</if>
    
  2. Call headerstuff.adp from the .tcl file you would like to use property header_stuff in:
    
    set cwd [file dirname [ad_conn file]]
    set headerstuff [template::adp_parse ${cwd}/headerstuff \
    	      [list \
    		   condition_1 $condition_1 \
    		   condition_2 $condition_2]]
    
  3. Then pass the header_stuff property like so:
    
    <property name="header_stuff">@headerstuff@</property>
    

/Bart

Collapse
4: Re: conditional property (response to 3)
Posted by Vinod Kurup on
Thanks Bart - that sounds like the best way to go.