[Geoserver-users] How to get a layer's title with freemarker?

Hi, I am trying to display a layer’s ‘title’ in a getfeatureinfo request by using ${type.title} in content.ftl but getting this error in the log:

2016-04-13 09:56:04,741 ERROR [freemarker.runtime] - Template processing error: “Expression type.title is undefined on line 3, column 34 in content.ftl.”

I am using the default content.ftl from http://docs.geoserver.org/stable/en/user/tutorials/GetFeatureInfo/index.html#tutorials-getfeatureinfo

${type.name} ...

Using the above content.ftl I have tested all type options listed on http://docs.geoserver.org/stable/en/user/tutorials/freemarker.html, and getting these results:

${type.name} - works, returns the layer’s name
${type.namespace} - works, returns the layer’s namespace
${type.prefix} - works, returns the layer’s prefix (workspace name)
${type.title} - does not work
${type.abstract} - does not work
${type.description} - does not work
${type.keywords} - does not work
${type.metadataLinks} - does not work
${type.SRS} - does not work
${type.nativeCRS} - does not work

Is it possible to return the layer’s title via freemarker? or what is the correct syntax for accessing the above variables?

Thanks.

Limerick …One of the ‘TOP 10 PLACES TO INVEST IN EUROPE’- Site Selection Magazine, 2014. Limerick City & County Council Disclaimer: This electronic message contains information (and may contain files), which may be privileged or confidential. The information is intended to be for the sole use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information and or files is prohibited. If you have received this electronic message in error, please notify the sender immediately. This is also to certify that this mail has been scanned for viruses. Tá eolas sa teachtaireacht leictreonach seo (agus b’fhéidir sa chomhaid ceangailte leis) a d’fhéadfadh bheith príobháideach nó faoi rún. Is le h-aghaidh an duine/na ndaoine nó le h-aghaidh an aonáin atá ainmnithe thuas agus le haghaidh an duine/na ndaoine sin amháin atá an t-eolas. Murab ionann tusa agus an té a bhfuil an teachtaireacht ceaptha dó bíodh a fhios agat nach gceadaítear nochtadh, cóipeáil, scaipeadh nó úsáid an eolais agus/nó an chomhaid seo. Más trí earráid a fuair tú an teachtaireacht leictreonach seo cuir, más é do thoil é, an té ar sheol an teachtaireacht ar an eolas láithreach. Deimhnítear leis seo freisin nár aimseodh víreas sa phost seo tar éis a scanadh.

···

GIS TEAM
Limerick City and County Council
Email gis@limerick.ie