> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enterspeed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Latest news

A schema for listing the 3 latest news articles with a filter for global news category.

<CodeGroup>
  ```js JavaScript - FrontPage schema with latest news icon="square-js" theme={null}
  /** @type {Enterspeed.FullSchema} */
  export default {
    triggers: function(context) {
      context.triggers("cms", ["frontPage"]);
    },
    routes: function(sourceEntity, context) {
      context.url(sourceEntity.url);
    },
    properties: function (sourceEntity, context) {
      return {
        title: sourceEntity.properties.name,
        description: sourceEntity.properties.description,
        latestNews: context
                  .reference("news")
                  .filter("type eq 'news' and properties.category eq 'globalNews'")
                  .orderBy({propertyName: "properties.date", direction: "desc"})
                  .limit(3)
      };
    }
  }
  ```
</CodeGroup>
