Authoring Content Fragments authoring-content-fragments
Authoring your Content Fragments is focused on both headless delivery and page authoring.
There are two editors available for Content Fragments. The editor described in this section:
- has been developed for headless content delivery (though it can be used for all scenarios)
- is available from the Content Fragments console
This editor provides:
- Auto-saving, to prevent accidental loss of edits.
- In-line uploading of assets as content references, without having to upload them to the Asset DAM first.
- Preview of the rendered experience delivered by the Content Fragment.
- Ability to Publish and Unpublish from the editor.
- Ability to view, and open, associated language copies in the editor.
- Ability to view version details in the editor. You can also revert to a selected version.
- Ability to view, and open, parent references.
- A hierarchical view of the Content Fragment, and its references, using the Structure tree.
Content Fragment Editor content-fragment-editor
When you first open the Content Fragment Editor, you see four main areas:
-
top toolbar: for key information, and actions
-
a link to the Content Fragment Console (Home icon)
-
information about the model, and folder
-
links to Preview (if the Default Preview URL Pattern is configured for the model)
-
an option to show all Parent References (link icon)
-
the fragment Status, and last saved information
-
a toggle to switch to the original (Assets-based) editor
note warning WARNING The original editor opens in the same tab. It is not recommended to have both editors open at the same time.
-
-
left panel: shows the Variations for the Content Fragment, and its Fields:
- these links can be used to navigate the Content Fragment structure
-
right panel: presents tabs showing the properties (metadata) and tags, information about the version history, and information related to any language copies
- in the Properties tab you can update the Title and Description for the fragment, or Variation
-
central panel: shows the actual fields, and content, of the selected variation
- allows you to edit the content
- if Tab Placeholder fields are defined within the model they are shown here, and can be used for navigating; they will either be presented horizontally, or as a drop-down list.
note note NOTE Depending on definitions in the underlying model, fields can be subject to certain types of Validation.
Navigate the Content Fragment structure navigate-structure
A single Content Fragment;
-
Consists of two levels:
- Variations of the Content Fragment
- Fields - defined by the Content Fragment Model, and used by every variation
-
Can contain a variety of references.
Variations and Fields variations-and-fields
In the left panel you can see:
-
the list of Variations that have been created for this fragment:
- Main is the Variation that is present when the Content Fragment is first created, you can add others later
- you can select and open a Variation for editing
- you can also create a Variation
-
the Fields within the fragment, and its variations:
- the icon indicates the Data Type
- the text is the field name
- together these provide a direct link to the field content in the central panel (for the current Variation)
Follow Links follow-links
In various parts of the editor you can see the link icon. This can be used to open the item shown; for example, a Content Fragment Model, a Parent Reference, or a fragment being referenced:
Structure tree structure-tree
Open the Structure tree tab from the editor toolbar to show the hierarchical structure of the Content Fragment, and its references. Use the link icons to navigate to the references.
Saving and auto-saving saving-autosaving
With every update that you make, the Content Fragment is automatically saved. The last time saved is shown in the top toolbar.
Variations variations
Variations are a significant feature of AEM’s Content Fragments. They allow you to create and edit copies of the Main content for use on specific channels, and scenarios, making headless content delivery and page authoring even more flexible.
From the editor you can:
-
Create variations of the Main content
-
Select the required variation for editing the content
Create a Variation create-variation
To create a Variation of your Content Fragment:
-
In the left panel, select the plus sign (Create variation) that is to the right of Variations.
note note NOTE After creating your first variation, existing variations will be listed in the same panel. -
In the dialog, enter a Title for your variation, and a Description if wanted:
-
Create the variation. It appears in the list.
Rename a Variation rename-variation
To rename a Variation:
-
Select the required variation.
-
Open the Properties tab in the right panel.
-
Update the variation Title.
-
Either press Return or move to another field to auto-save the change. The title is updated in the Variations panel on the left.
Delete a variation delete-variation
To delete a Variation of your Content Fragment:
-
Select the Variation.
-
In the Variation panel, select the delete icon (Trash Can):
-
A dialog opens. Select Delete to confirm the action.
Edit Multi line text fields - Plain text or Markdown edit-multi-line-text-fields-plaintext-markdown
Multi line text fields can have one of three formats:
Fields that are defined as either Plain Text or Markdown have a simple text box, without (on-screen) formatting options:
Edit Multi line text fields - Rich Text edit-multi-line-text-fields-rich-text
For Multi line text fields that are defined as Rich Text, various features are available:
-
Edit the content:
- Undo/Redo
- Paste/Paste as Text
- Copy
- Select paragraph format
- Create/manage table
- Format text; bold, italic, underline, color
- Set paragraph alignment
- Create/manage lists; bulleted, numbered
- Indent text; decrease, increase
- Clear current formatting
- Insert links
- Select and insert references to image assets
- Add special characters
-
Full-screen editor - toggle between full-screen and in-flow
For example:
Full-screen editor - Rich Text full-screen-editor-rich-text
The full-screen editor offers the same editing options as when in-flow - but offers more space for the text.
For example:
Statistics - Rich Text statistics-rich-text
The action Statistics displays a range of information about the text in a Multi line field.
For example:
Compare and Synchronize - Rich Text compare-and-synchronize-rich-text
The action Compare is available for Multi line fields when you have a Variation open.
This opens the Multi line field in full-screen and:
-
displays the content for both Main and the current Variation in parallel, with any differences highlighted
-
differences are indicated by color:
- green indicates content added (to the variation)
- red indicates content removed (from the variation)
- blue indicates replaced text
-
provides the Sync action, which synchronizes the content from Main to the current variation
- if Main has been updated, then these changes will be transferred to the variation
- if the variation has been updated, then these changes will be overwritten by the content from Main
note caution CAUTION Synchronization is only available to copy changes from Main to the variation. Transferring changes from a variation to Main is not available as an option.
For example, a scenario where the variation content had been completely rewritten, so a synchronization will replace that new content with the content from Main:
Manage References manage-references
Fragment References fragment-references
Fragment References can be used to:
Create a reference to an existing Content Fragment create-reference-existing-content-fragment
To create a reference to an existing Content Fragment:
-
Select the field.
-
Select Add existing fragment.
-
Select your required fragment from the fragment selector.
note note NOTE You are allowed to select only one fragment at a time.
Create a Content Fragment, and reference create-reference-content-fragment
Alternatively you can select Create new fragment to open the Create dialog. Once created, this fragment will be referenced.
Content References content-references
Content References are used to reference other AEM content types, such as images, pages, and Experience Fragments.
Reference Images reference-images
In Content Reference fields you can both:
-
reference assets that already exist in the repository
-
upload them directly to the field; this avoids the need to use the Assets console to upload
note note NOTE To directly upload an image to the Content Reference field, it must: - have a Root Path defined (in the Content Fragment Model). This specifies where the image will be stored.
- include Image in the list of accepted content types
To add an asset, you can either:
-
drag and drop the new asset file directly (for example, from your file system) into the Content Reference field
-
use the Add asset action, then select either Browse Assets or Upload to open the appropriate selector for you to use:
Reference Pages reference-pages
To add references to AEM pages, Experience Fragments, or other content types:
-
Select Add content path.
-
Add the required path in the input field.
-
Confirm with Add.
View Parent References view-parent-references
Selecting the link icon in the top toolbar opens a list of all parent references.
For example:
A window opens, listing all related references. To open a reference, select the name or title, or the link icon.
For example:
View Properties, and Tags view-properties-tags
In the properties tab of the right panel, properties (metadata) and tags can be viewed. The properties can be either:
- for the Content Fragment - if Main is currently selected
- for a specific Variation
Edit Properties and Tags edit-properties-tags
In the properties tab (right panel) you can also edit:
-
Title
-
Description
-
Tags: using the drop-down list, or the selection dialog
Open the Content Fragment Model open-content-fragment-model
When you have Main selected, the name of the underlying Content Fragment Model is shown in the properties section. Selecting the link icon, opens the model in a separate tab.
For example:
View the Version History view-version-history
In the Version history tab of the right panel, details of the current, and previous, versions are shown:
Revert to a Version revert-version
You can revert to any version.
To revert to a specific version:
-
Select the three dots icon next to the version.
-
Select Revert.
View the Language Copies view-language-copies
In the Language properties tab details of any related language copies are shown. Selecting a link icon, opens the copy in a separate tab.
For example:
Preview your Fragment preview-content-fragment
The Content Fragment editor provides authors with the option to preview their edits in an external frontend application.
To use this feature, you first need to:
- Work with your IT team to set up the external frontend application that will render the Content Fragment by consuming its JSON output.
- When the external frontend application is set up, the Default Preview URL Pattern must be defined as a property of the appropriate Content Fragment Model.
When the URL has been defined, the Preview button is active. You can select this button to launch the external application (in a separate tab) to render the Content Fragment.
Publish your Fragment publish-content-fragment
You can Publish your fragment to either your:
- Preview instance
- Publish instance
You can publish your fragment from either the editor, or the console. See Publishing and Previewing a Fragment for full details.
Unpublish your Fragment unpublish-content-fragment
You can also Unpublish your fragment from either your:
- Preview instance
- Publish instance
You can unpublish your fragment from either the editor, or the console. See Unpublishing a fragment for full details.
Fields, Data Types and Icons fields-datatypes-icons
The Fields panel lists all fields within the Content Fragment. The icon indicates the Data Type:
Good to know good-to-know
-
To edit a Content Fragment you need the appropriate permissions. Contact your system administrator if you are experiencing issues.
For example, if you do not have
edit
permissions the editor will be read-only. -
A Content Fragment Model can often define data fields named Title and Description. If these fields exist, they are user-defined fields and can be updated in the central panel when editing the fragment.
The Content Fragment, and its variations, also have metadata fields (Variation properties) called Title and Description. These fields are an integral part of any Content Fragment and initially defined when the fragment. They can be updated in the right panel when editing the fragment.
-
See the Assets documentation for full information about the original Content Fragment editor - it is available from both the Assets console and the Content Fragments console.
-
Your project team can customize the editor if necessary. See Customizing the Content Fragment Console and Editor for further details.