.. _community_wfsfreemarker_config: WFS FreeMarker Extension configuration ====================================== Template Lookup ``````````````` Reference: :ref:`tutorials_getfeatureinfo` Example Configuration on a Vector Layer `````````````````````````````````````````` The WFS GetFeature can generate output in various formats: GML, GeoJSON, ... and, through this extension, also HTML. WFS Templating is concerned with the HTML one. Assume we have a Vectorial layer named :guilabel:`geosolutions:bplandmarks` #. Go to the Layer preview to show :guilabel:`geosolutions:bplandmarks` layer. #. Search for the HTML format from the :guilabel:`All Formats` select-box, under the WFS ones. .. figure:: images/info1.png #. In order to configure a custom template of the GetFeature results create three files ``.ftl`` in ``$geoserver_data/workspaces/geosolutions`` directory named: .. code:: - header.ftl - content.ftl - footer.ftl .. note:: The Template is managed using Freemarker. This is a simple yet powerful template engine that GeoServer uses whenever developers allowed user customization of textual outputs. In particular, at the time of writing, it’s used to allow customization of GetFeatureInfo, GeoRSS and KML outputs. .. note:: Splitting the template in three files allows the administrator to keep a consistent styling for the GetFeatureInfo result, but use different templates for different workspaces or different layers. This is done by providing a master header.ftl and footer.ftl file, but specify a different content.ftl for each layer. #. In header.ftl file enter the following HTML: .. code:: <#-- Header section of the GetFeatureInfo HTML output. Should have the
section, and a starter of the . It is advised that eventual CSS uses a special class for featureInfo, since the generated HTML may blend with another page changing its aspect when using generic classes like td, tr, and so on. -->