<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=906155819-07042010>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=906155819-07042010></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=906155819-07042010>you can try to use javascript in your template. Below 
an example (it's the whole template, nothing cut out) I use to get different 
colors for my table rows.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=906155819-07042010></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2>&lt;script&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>var idx = 
parseInt("[lrn]")%2;<BR>var myClass = "tdBody" + idx;</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=906155819-07042010><FONT face=Arial color=#0000ff size=2>//that 
should only be written for the first row</FONT></SPAN></DIV>
<DIV><SPAN class=906155819-07042010><FONT face=Arial color=#0000ff 
size=2>if([lrn]==1)</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>document.write("<SPAN 
class=906155819-07042010>[<FONT face="Courier New" 
color=#000000>provincename</FONT>]&lt;hr&gt;</SPAN>");<BR></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2>document.write("&lt;tr 
class='tblBody'&gt;");<BR>document.write("&nbsp;&nbsp;&nbsp; &lt;td class='" + 
myClass + 
"'&gt;[PROJEKTNUMMER]&lt;/td&gt;");<BR>document.write("&nbsp;&nbsp;&nbsp; &lt;td 
class='" + myClass + 
"'&gt;[PROJEKTBEZEICHNUNG]&lt;/td&gt;");<BR>document.write("&nbsp;&nbsp;&nbsp; 
&lt;td class='" + myClass + 
"'&gt;[ART][lrn]&lt;/td&gt;");<BR>document.write("&nbsp;&nbsp;&nbsp; &lt;td 
class='" + myClass + 
"'&gt;[AGNR]&lt;/td&gt;");<BR>document.write("&nbsp;&nbsp;&nbsp; &lt;td class='" 
+ myClass + 
"'&gt;[AG]&lt;/td&gt;");<BR>document.write("&lt;/tr&gt;");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2>&lt;/script&gt;<BR></FONT></DIV>
<DIV><SPAN class=906155819-07042010></SPAN><FONT face=Arial><FONT 
color=#0000ff><FONT size=2>Arnd</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=906155819-07042010></SPAN></FONT></FONT></FONT><BR>&nbsp;</DIV>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> mapserver-users-bounces@lists.osgeo.org 
[mailto:mapserver-users-bounces@lists.osgeo.org] <B>Im Auftrag von 
</B>Steve.Toutant@inspq.qc.ca<BR><B>Gesendet:</B> Mittwoch, 7. April 2010 
21:15<BR><B>An:</B> Daniel Morissette<BR><B>Cc:</B> 
mapserver-users@lists.osgeo.org; 
mapserver-users-bounces@lists.osgeo.org<BR><B>Betreff:</B> Re: [mapserver-users] 
record element in query header<BR></FONT><BR></DIV>
<DIV></DIV><BR><FONT face=sans-serif size=2>Thanks!</FONT> <BR><FONT 
face=sans-serif size=2>Here is more details on what I need to do</FONT> 
<BR><FONT face=sans-serif size=2>Suppose I have one layer which contains the 
province in canada and their cities.</FONT> <BR><FONT face=sans-serif 
size=2>When the user hover or click on a province, I want this information in a 
popup or a div (the client is openlayers and I use 
OpenLayers.Control.WMSGetFeatureInfo)</FONT> <BR><BR><FONT face=sans-serif 
size=2>If the user click on the province of Quebec....</FONT> <BR><FONT 
face=sans-serif size=2>There are 2000 cities in Quebec</FONT> <BR><FONT 
face=sans-serif size=2>1: city name 1</FONT> <BR><FONT face=sans-serif size=2>2: 
city name 2</FONT> <BR><FONT face=sans-serif size=2>...</FONT> <BR><FONT 
face=sans-serif size=2>2000: city name 2000</FONT> <BR><BR><FONT face=sans-serif 
size=2>So In this case I think a field name should be supported in a header 
template</FONT> <BR><BR><FONT face=sans-serif size=2>Perhaps I misunderstood 
what should be managed by the client or the server??</FONT> <BR><BR><FONT 
face=sans-serif size=2>thanks again</FONT> <BR><FONT face=sans-serif 
size=2>Steve</FONT> 
<P><BR><BR><BR>
<TABLE width="100%">
  <TBODY>
  <TR vAlign=top>
    <TD width="40%"><FONT face=sans-serif size=1><B>Daniel Morissette 
      &lt;dmorissette@mapgears.com&gt;@lists.osgeo.org</B> </FONT><BR><FONT 
      face=sans-serif size=1>Envoyé par : 
      mapserver-users-bounces@lists.osgeo.org</FONT> 
      <P><FONT face=sans-serif size=1>07/04/2010 02:16 PM</FONT> </P>
    <TD width="59%">
      <TABLE width="100%">
        <TBODY>
        <TR vAlign=top>
          <TD>
            <DIV align=right><FONT face=sans-serif size=1>A</FONT></DIV>
          <TD><FONT face=sans-serif 
            size=1>mapserver-users@lists.osgeo.org</FONT> 
        <TR vAlign=top>
          <TD>
            <DIV align=right><FONT face=sans-serif size=1>cc</FONT></DIV>
          <TD>
        <TR vAlign=top>
          <TD>
            <DIV align=right><FONT face=sans-serif size=1>Objet</FONT></DIV>
          <TD><FONT face=sans-serif size=1>Re: [mapserver-users] record 
            element in query header</FONT></TR></TBODY></TABLE><BR>
      <TABLE>
        <TBODY>
        <TR vAlign=top>
          <TD>
          <TD></TR></TBODY></TABLE><BR></TR></TBODY></TABLE><BR><BR><BR><BR><BR><TT><FONT 
size=2>Steve.Toutant@inspq.qc.ca wrote:<BR>&gt; <BR>&gt; If I put [provincename] 
in the template I got the value, per example<BR>&gt; In the Template<BR>&gt; 
[lrn]: [provincename] - [elementname]&lt;br&gt;<BR>&gt; <BR>&gt; The result 
is:<BR>&gt; 1: Québec - blabla 1<BR>&gt; 2: Québec - blabla 2<BR>&gt; 3: Québec 
- blabla 3<BR>&gt; <BR>&gt; But I don't want to put it in the template since the 
same information <BR>&gt; will be repeated.<BR>&gt; thanks for your 
help!<BR><BR>I'm not exactly sure if a field name should be supported in the 
header <BR>template, but based on a quick browse of the code there are two other 
<BR>ways you could possibly pass the information (depending on what you have 
<BR>on the client side):<BR><BR>1- You can use parameters from the URL in a 
template tag. e.g. if you <BR>pass myprov=Quebec in the URL then you should be 
able to use [myprov] in <BR>your template.<BR><BR>2- You can reference 
layer-level metadata in query templates using <BR>[metadata_...]<BR><BR>(Those 
are untested hints based on a quick browse of the source)<BR><BR>Daniel<BR>-- 
<BR>Daniel 
Morissette<BR>http://www.mapgears.com/<BR>_______________________________________________<BR>mapserver-users 
mailing 
list<BR>mapserver-users@lists.osgeo.org<BR>http://lists.osgeo.org/mailman/listinfo/mapserver-users<BR></FONT></TT><BR><BR><BR></P></BODY></HTML>