Ticket #3701 (closed enhancement: fixed)

Opened 2 years ago

Last modified 20 months ago

Allow setting an attribute so content can be displayed when layers don't have query results.

Reported by: sdlime Owned by: jmckenna
Priority: normal Milestone: 6.0 release
Component: Documentation - MapServer Version: unspecified
Severity: normal Keywords: templates
Cc: havatv

Description

Need to add an attribute to the [resultset ...] tag so that we can display something if a layer doesn't have any results. For example we might output an empty object for JSON output...

Steve

Change History

Changed 2 years ago by sdlime

  • owner changed from sdlime to jmckenna
  • component changed from MapServer C Library to MapServer Documentation

Added in r11026, also added to a template test in msautotest (query/template.map) that I'll commit soon. Moving to documentation component. -Steve

Changed 2 years ago by sdlime

Oops, syntax is like so:

[resultset layer="foo" nodata="layer foo has no results available"]
  [feature]...[/feature]
[/resultset]

Normal operation would be to output with nothing for this block if layer foo had no results (e.g. nodata="").

Steve

Changed 20 months ago by havatv

  • cc havatv added
  • status changed from new to closed
  • resolution set to fixed

Fixed in 6.0 and trunk documentation in r12651. Updated template_output with nodata as an attribute to resultset. Also modified the formatting (so the nodata changes will be a bit difficult to find..., sorry).

Note: See TracTickets for help on using tickets.