On 31 October 2011 15:15, Ragnvald Larsen <ragnvald.lar...@dirnat.no> wrote:
> I am having a problem with attribute orders while using FTL. My sweet > content.ftl file looks like this:**** > > ** ** > > <TABLE bordercolorlight="#D7E4B2" class="table_design" ALIGN="CENTER" > border="1">**** > > <TR class="record_heading">**** > > <TH>Art</TH>**** > > <TH>Latin</TH>**** > > <TH>Areal (km2)</TH>**** > > ** ** > > </TR>**** > > ** ** > > <#list features as feature> **** > > <TR class="record">**** > > <#list feature.attributes as attribute>**** > > <#if !attribute.isGeometry> > **** > > **** > > > <#if attribute.name="art_norsk">**** > > > <TD Align="Center">${attribute.value}</TD>**** > > > </#if>**** > > > <#if attribute.name="art_latins">**** > > > <TD Align="Center">${attribute.value}</TD>**** > > > </#if>**** > > > <#if attribute.name="km2">**** > > > <TD Align="Center">${attribute.value}</TD>**** > > > </#if>**** > > ** > ** > > </#if>**** > > </#list>**** > > ** ** > > </TR> **** > > </#list>**** > > </TABLE>**** > > ** ** > > It produces this getfeatureinfo for html:**** > > ** ** > > *Art* > > *Latin* > > *Areal (km2)* > > 6298.26717326**** > > Bjørn**** > > Ursus arctos**** > > ** ** > > The feature attributes (from a shapefile) is presented in the order of the > data within the shapefile (km2, art_norsk, art_latins), and not according > to my content.ftl-script (art_norsk, art_latins, km2). The shapefile in > question is available here: > User error I'm afraid - if you want to specify the order for your output you need to loop through the attributes each time just selecting the one you want at that point. <#list feature.attributes as attribute> <#if !attribute.isGeometry> <#if attribute.name="art_norsk"> <TD Align="Center">${attribute.value}</TD> </#if> </#if> </#list> <#list feature.attributes as attribute> <#if !attribute.isGeometry> <#if attribute.name="art_latins"> <TD Align="Center">${attribute.value}</TD> </#if> </#if> </#list> <#list feature.attributes as attribute> <#if !attribute.isGeometry> <#if attribute.name="km2"> <TD Align="Center">${attribute.value}</TD> </#if> </#if> </#list> Ian
------------------------------------------------------------------------------ Get your Android app more play: Bring it to the BlackBerry PlayBook in minutes. BlackBerry App World™ now supports Android™ Apps for the BlackBerry® PlayBook™. Discover just how easy and simple it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users