Chapter 3 - Authoring Event Content Fragments

Last update: 2023-04-03
  • Created for:
  • Beginner

Chapter 3 of the AEM Headless tutorial covers creating and authoring Events Content Fragments from the Content Fragment Model created in Chapter 2.

Authoring an Event Content Fragment

With an Event Content Fragment Model created and the AEM Configuration for WKND applied to the /content/dam/wknd-mobile Asset folder (via the cq:conf property), a Event Content Fragment can be created.

Content Fragments, which are a type of Asset, should be organized and managed in AEM Assets just like other assets.

  • Use locale folders in the Assets folder structure if translation is (or may be) required
  • Logically organize Content Fragments so they are easy to locate and manage

In this step, well create a new Event for Punkrock Fest in the /content/dam/wknd-mobile/en/events assets folder.

  1. Navigate to AEM > Assets > Files > WKND Mobile > English and create Asset folders Events.

  2. Within Assets > Files > WKND Mobile > English > Events create a new Content Fragment of type Event with a title of Punkrock Fest.

  3. Author the newly created Event Content Fragment.

    • Event Title : Punkrock Fest
    • Event Description : <Enter a few lines of description…>
    • Event Date : <Select a date in the future>
    • Event Type : Music
    • Ticket Price : 10
    • Event Image : /content/dam/wknd-mobile/images/tom-rogerson-574325-unsplash.jpg
    • Venue Name : The Reptile House
    • Venue City : New York

    Tap Save in the top action bar to save changes.

  4. Using AEM’s Package Manager, install the package below on AEM Author. This package contains a number of Event Content Fragments.

    Get File: GitHub > Assets >

Reviewing the Content Fragment’s JCR structure

This section is informational only and meant to socialize the underlying JCR structure of Content Fragments made from Content Fragment Models.

  1. Open CRXDE Lite on AEM Author.
  2. In CRXDE Lite, on the left-hand hierarchy menu, navigate to /content/dam/wknd-mobile/en/events/punkrock-fest/jcr:content which is the node representing the Punkrock Fest Event Content Fragment in the JCR.
  3. Expand the data node.
    Review in the Properties pane that it has a property cq:model that points to the Event Content Fragment Model definition.
    • cq:model = /conf/settings/wknd-mobile/dam/cfm/models/event
  4. Beneath the data node select the master node and review the properties. This node contains the content collected during the authoring of an Event Content Fragment Model. The JCR property names correspond to the Content Fragment Model property name’s, and the values correspond to the authored values of the “Punkrock Fest” Event Content Fragment.

Next step

It is recommended, you install the content package on AEM Author via AEM’s Package Manager. This package contains the configurations and content outlined in this and preceding chapters of the tutorial.

On this page