[Zope-dev] Global Variable

Leon de Heus leon@pruts.nl
26 Nov 2001 17:17:42 +0100


Hi Pascal,

In the dtml-in loop you can set the variable in the request by using
<dtml-call "REQUEST.set('varname', _.getitem('sequence-item').id)">

 <dtml-in "portal_catalog.searchResults(Type='Cas clinique',           
 review_state='published', sort_on='Date', sort_order='reverse')"      
 size=1 end=1>                                                         
  <dtml-call "REQUEST.set('cas_clinique_id', _.getitem('sequence-item').id)">
 </dtml-in>                                                            

And then you can use it in the script section by using
 <dtml-var cas_clinique_id>

Hope that helps.

Best,
Leon de Heus.
          

Op Mon 26-11-2001, om 16:18 schreef Pascal Samuzeau:
> Hi,                                                                   
>                                                                       
> I've that code :                                                      
>                                                                       
>                                                                       
> <dtml-let TEST="'dir'">                                               
> <dtml-in "portal_catalog.searchResults(Type='Cas clinique',           
> review_state='published', sort_on='Date', sort_order='reverse')"      
> size=1 end=1>                                                         
>  <dtml-var id>                                                        
> </dtml-in>                                                            
> </dtml-in>                                                            
>                                                                       
> <script type="text/javascript">                                       
>                                                                       
> var image   = 0;                                                      
> var delai   = 2000;                                                   
> var icone   = new Array ();                                           
> var lelien  = '';                                                     
> var max     =  <dtml-var                                              
> "compte_images(repertoire='/uv/web/cnr/cas/&TEST;',prefixe='Ima-') -  
> 1">;                                                                  
>                                                                       
> I need to get the value returned by the <dtml-var id> in the function 
> called "compte_images" and in some others later in the code.          
>                                                                       
> My question : I need something like a global variable, that I may use 
> here and there.                                                       
>                                                                       
> But, infortunately, I don't know how to write it.                     
>                                                                       
> Anyone knows it ?                                                     
>                                                                       
> Thank you