Configure Human-Readable Date Facets
Configure human-readable date facets in a faceted tree.
When using a date property as a facet in a faceted navigation, facet values will show as milliseconds since epoch by default. To make date facets understandable for human beings, it is possible to configure date resolutions such as year, month, and day.
To specify a resolution for a date facet, add a dollar sign ($) and the desired resolution after the property name in hippofacnav:facets. For example:
The following date resolutions are available:
day ( = day of month)
To enable navigation of news documents (from the out-of-the-box News feature) by publication date, configure a faceted tree as follows:
/content/documents/myhippoproject: /faceted-news: jcr:primaryType: hippofacnav:facetnavigation hippo:docbase: d2b1775c-fb97-4080-bd66-ede4ac874b5a hippofacnav:facets: [ myhippoproject:date$year, myhippoproject:date$month, myhippoproject:date$day ] hippofacnav:facetnodenames: [ Year, Month, Day ]
The result is a faceted tree as in the example below:
/content/documents/myhippoproject: /faceted-news : /Year : /2015 : /2016 : /Year : /Month : /6 : /8 : /Year : /Month : /Day : /12 : /17 : /23 : /hippo:resultset : /hippo:resultset : /9 : /hippo:resultset : /Day : /hippo:resultset : /2017 : /hippo:resultset : /Month : /Day : /hippo:resultset :
Using such a faceted tree, a delivery tier implementation can render a faceted navigation which enables users to narrow their search results down by year, month, and day of the month. It is even possible to render the navigation as a calendar (see Events in the online GoGreen demo for an example).