<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta name="Generator" content="Zarafa WebAccess v5.22-8825">
  <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
  <title>RE: [mapserver-users] Dinamically changing HTML Template using CGIparameter? (instead of hardcoded)</title>
  <style type="text/css">
      body
      {
        font-family: Arial, Verdana, Sans-Serif;
        font-size: 12px;
        padding: 5px 5px 5px 5px;
        margin: 0px;
        border-style: none;
        background-color: #ffffff;
      }

      p, ul, li
      {
        margin-top: 0px;
        margin-bottom: 0px;
      }
  </style>
</head>
<body>
<p>Hi Kresh,</p><p>&nbsp;</p><p>In Mapserver 4.x the method is slightly different. You can use :</p><p>&nbsp;</p><p>map_web_template=othertemplate.html</p><p>&nbsp;</p><p>Regards,</p><p>&nbsp;</p><p>Wim Blanken<br /><br /><blockquote style="padding-left: 5px; margin-left: 5px; border-left: #325fba 2px solid">-----Original message-----<br /><strong>From:</strong> kreshna_iceheart@yahoo.com<br /><strong>Sent:</strong> Fri 06/06/08 05:45:14<br /><strong>To:</strong> Wim Blanken &lt;w.blanken@geon.nl&gt;; <br /><strong>Subject:</strong> RE: [mapserver-users] Dinamically changing HTML Template using CGIparameter? (instead of hardcoded)<br /><br /><table style="font-size: 10pt; width: 100%; color: #000000; background-color: transparent; &#39;font-family: Arial" cellspacing="\&#39;0\&#39;" cellpadding="\&#39;0\&#39;" background="\&#39;none\&#39;" border="\&#39;0\&#39;"><tbody><tr><td style="&#39;font: " valign="\&#39;top\&#39;">Hi, thank you, Wim. I&#39;m using ms4w 4.4.0 by the way, but I&#39;ll definitely try the methods you&#39;ve mentioned.<br /><br />Many thanks,<br />-Kresh<br /><br /><br /><br />--- On <strong>Tue, 6/3/08, Wim Blanken <em>&lt;w.blanken@geon.nl&gt;</em></strong> wrote:<br /><blockquote style="&#39;border-left-color: ">From: Wim Blanken &lt;w.blanken@geon.nl&gt;<br />Subject: RE: [mapserver-users] Dinamically changing HTML Template using CGIparameter? (instead of hardcoded)<br />To: mapserver-users@lists.osgeo.org<br />Date: Tuesday, June 3, 2008, 12:13 PM<br /><br /><div id="yiv645303943"><div class="Section1"><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">Hello Kresh,</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">&nbsp;</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">Sorry, I did not read you question carefull enough&hellip;.the answer is about changing the template of a single layer and not the main template.</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">&nbsp;</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">Changing the main map template goes with cgi (mapserver 5) i believe as follows: </span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">&nbsp;</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">&hellip;&hellip;&hellip;&hellip;&hellip;..&amp;map_web=TEMPLATE+othertemplate.html</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">&nbsp;</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">Sorry for the inconvenience&hellip;.</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">&nbsp;</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">Wim Blanken</span></font></p><p class="MsoNormal"><font face="Arial" color="#000080" size="2"><span style="&#39;font-size: ">The Netherlands</span></font></p><div><div class="MsoNormal" style="&#39;text-align: " align="center"><font face="Times New Roman" size="3"><span style="&#39;font-size: "><hr tabindex="0" align="center" width="100%" size="2" /></span></font></div><p class="MsoNormal"><strong><font face="Tahoma" size="2"><span style="&#39;font-size: ">Van:</span></font></strong><font face="Tahoma" size="2"><span style="&#39;font-size: "> mapserver-users-bounces@lists.osgeo.org [mailto:mapserver-users-bounces@lists.osgeo.org] <strong><span style="&#39;font-weight: ">Namens </span></strong>kreshna_iceheart@yahoo.com<br /><strong><span style="&#39;font-weight: ">Verzonden:</span></strong> Tuesday, June 03, 2008 5:16 PM<br /><strong><span style="&#39;font-weight: ">Aan:</span></strong> mapserver-users@lists.osgeo.org<br /><strong><span style="&#39;font-weight: ">Onderwerp:</span></strong> [mapserver-users] Dinamically changing HTML Template using CGIparameter? (instead of hardcoded)</span></font></p></div><p class="MsoNormal"><font face="Times New Roman" size="3"><span style="&#39;font-size: ">&nbsp;</span></font></p><table class="MsoNormalTable" style="&#39;width: " cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff" border="0"><tbody><tr><td style="&#39;padding-top: " valign="top"><p class="MsoNormal" style="&#39;margin-bottom: "><font face="Arial" color="#333333" size="2"><span style="&#39;font-size: ">I have one mapfile, let say, PACITAN.MAP, with two template files: PACITAN-TMPL.HTML and PACITAN-PRINT-TMPL.HTML. The former is the &quot;primary&quot; template for the normal web map display, while the latter has &quot;cleaner look&quot; for printing purpose (print page).<br /><br />The print page (PACITAN-PRINT-TMPL.HTML) is called from the &quot;primary&quot; template page using JavaScript window.open() function. <br /><br />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.<br /><br />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&nbsp; (hard-coded in the mapfile, of course).<br /><br />If I can dynamically change the name of the HTML template using CGI parameters, I don&#39;t have to use two versions of mapfile; I can just use one mapfile with two HTML templates and be done with it.<br /><br />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:<br /><br />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.<br /><br />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?<br /><br />Many thanks,<br />-Kresh<br /><br /></span></font></p></td></tr></tbody></table><p class="MsoNormal"><font face="Times New Roman" size="3"><span style="&#39;font-size: ">&nbsp;</span></font></p></div></div><pre>_______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users</pre></blockquote></td></tr></tbody></table><br /></blockquote></p>
</body>
</html>