Template problems

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Fri Jun 2 17:47:18 PDT 2006


That would be:

myVariable0 = "[ROADS]";

Put that in the template and mapserver will set the value. If you want 
an array, I think it is possible with something like the following 
kwywords in the mapfile and place the follow code in each template:

HEADER   "/path/to/roads_header.html"

   <html>
   <head>

   ...

   <script ....>
   <!--
       var ai = 0;
       var a = new Array();

TEMPLATE "/path/to/roads_query.html"

       s[ai] = "[ROADS]"; ai++;

FOOTER   "/path/to/roads_footer.html"

   -->
   </script>
   </head>
   <body>

    ...

-Steve W


Steve Lime wrote:
> Since templates are processed before the browser gets them then I don't see how this
> can possibly work. Why do you want to do that anyway?
> 
> Steve
> 
>>>> "Sievers, Jason" <jsievers at CO.LINN.OR.US> 6/1/2006 6:45:14 PM >>>
> Hello all.
>  
> I have a MapServer HTML Template and am performing template substitutions.
> I would like reference values using JavaScript variables containing the
> template substitution.  For example, simply getting the MapServer version
> number is easy via "[ROADS]", where 'ROADS' is the name of a field in a
> dBase file.  But I want to get the value as a variable like 
>  
> myVariable0 = "ROADS";
> myVariable1 = '"[' + myVariable0 + ']"';
>  
> Any thoughts are welcome.
>  
>  
> Thanks, 
>  
> Jason Sievers
> 



More information about the MapServer-users mailing list