# Exercise 6.7: Configure data field and Event content type

For this exercise, we’ll provide hints - try to configure the event listing content type without looking back on the notes/previous instructions.

First, we’ll look at a simple view to filter out past events, then we’ll make a calendar entry using templates.

![Image of Events listing](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-1b8e6ad56e95bc94f5961fef1bef464f1e35f29d%2F44.png?alt=media)

In this exercise we’re going to prepare the date settings and configure the event content type to get it ready for the next exercise.

## Review the Event content type

1. Using experience from the earlier tutorials about content types and fields, go to the **Manage Fields** page of the **Event** content type. Review fields available in GovCMS.
2. Move to the **Manage form display** page and reorder the fields in the Event content type, moving all custom fields (pattern field\_\[field-name]) except the Components field above the Body field. Leave the Components field below the Body.
3. Go to **Content** → **Add content** → **Event** and test the form, making further adjustments to the field position if required.
4. **Check permissions -** whenever you create a new content type, you always need to check the permissions. Allow Content Authors to create events. Ensure that site visitors can leave comments (the **Comment** module must be activated and configured).

## Configure the date settings on your site

This once-off step is required to ensure the website date and time is set in the correct way

> **Note:** You can also add custom data formats via the **Add format** button.

## Update the date field

Given events are in the future, we can’t use the date created date to list events. We need to add a date field. Follow instructions from earlier activities to create an event date field with these details:

| Label      | Event date          |
| ---------- | ------------------- |
| Field name | field\_event\_date  |
| Field type | Date range          |
| Widget     | Date and time range |

## Test and improve

1. Test the form by creating a new event entry. Notice the date field is in the middle of the form, but would be better placed higher up.
2. Change the order of fields, so the **Event date** is under the title.

## Change the URL alias

We’d like to set up the URLs so that all events are in a /events URL path, for example a URL path could be: /events/job-fair

> **Hint:** The Event path pattern is preconfigured in GovCMS, but if you find it different to the required pattern, then follow instructions for editing URL alias patterns. Use a pattern such as: events/\[node:title]

![Image of Event path pattern](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-b236faa680da509149717a0810f8e77146a58203%2F48.png?alt=media)

## Re-test

To test your changes, create another new event. Now, the date should appear under the event title and when you publish content it will have a unique URL following the /event path.

![Image of Event](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-f8447bda1d45df2bc612840bfff95e31a86b6671%2F49.png?alt=media)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://salsa-digital.gitbook.io/govcms-site-builder/unit-6-content-listing-with-views/related-content-by-term/exercice-6.7-configure-data-field-and-event-content-type.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
