I have one mapfile, let say, PACITAN.MAP, with two template files: 
PACITAN-TMPL.HTML and PACITAN-PRINT-TMPL.HTML. The former is the "primary" 
template for the normal web map display, while the latter has "cleaner look" 
for printing purpose (print page).

The print page (PACITAN-PRINT-TMPL.HTML) is called from the "primary" template 
page using JavaScript window.open() function. 

When calling the print page, I can easily pass (and manipulate, if necessary) 
map-related information using CGI parameters. For example, layer information 
(ie which layers are selected) is passed with layers=[layers] CGI parameter, 
while extent information is passed with mapext=[minx], [miny], [maxx], [maxy] 
parameter.

The problem is: since the name of HTML template is hard-coded in the *.map 
file, I have to create another map file named PACITAN-PRINT.MAP, which is 
basically an exact copy of PACITAN.MAP, but using PACITAN-PRINT-TMPL.HTML as 
template  (hard-coded in the mapfile, of course).

If I can dynamically change the name of the HTML template using CGI parameters, 
I don't have to use two versions of mapfile; I can just use one mapfile with 
two HTML templates and be done with it.

The problem is; is it possible to pass the name of the HTML template using CGI 
parameters? And if it is, then how? I have browsed MapServer documentations and 
this is all I found:

TEMPLATE has been removed, since the map_web_template syntax can be 
used to alter a template file. Simplifies security maintenance by only 
having to deal with this option in a single place. Note that the 
TEMPLATEPATTERN of the mapfile has to be used to enable this feature.

However, save the vague reference above, I just could not find any other 
explanation about the map_web_template syntax above. Is it a CGI parameter? Can 
I just use the map_web_template parameter in my url, to specify which template 
to use?

Many thanks,
-Kresh





      
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to