Managing Content Fragments
Some Content Fragment functionality requires the application of AEM 6.4 Service Pack 2 (22.214.171.124) or later .
Content Fragments are stored as Assets , so are primarily managed from the Assets console.
Content fragments are then used with authoring pages; see Page Authoring with Content Fragments .
Creating Content Fragments
Creating a Content Fragment
The method of creating a content fragment is (basically) the same for both simple and structured fragments:
- Navigate to the Assets folder where you want to create the fragment.
- Select Create , then Content Fragment to open the wizard.
- The first step of the wizard requires you to specify the basis of the new fragment.
After selection, use Next to proceed.
- This can be a:
- All available templates and models are displayed.
- In the Properties step specify:
- TitleThe fragment title.Mandatory.
- NameThe name; will be used to form the URL.Mandatory; will be automatically derived from the title, but can be updated.
- Select Create to complete the action, then either Open the fragment for editing or return to the console with Done .
Actions for a Content Fragment
In the Assets console a range of actions are available for your content fragments, either:
- From the toolbar; after selection of your fragment all appropriate actions are available.
- As quick actions ; a subset of actions available for the individual fragment cards.
Select the fragment to reveal the toolbar with applicable actions:
- Save the fragment as a ZIP file; you can define whether to include Elements, Variations, Metadata.
- Allows you to view and/or edit the fragment's metadata.
- Allows you to open the fragment for editing content together with its elements, variations, associated content and metadata.
- Manage Tags
- To Collection
- Add the fragment to a collection.
- This can also be done when associating a collection with the fragment .
- Quick Publish
- Manage Publication
Opening the Fragment Editor
To open your fragment for editing:
To edit a content fragment you need the appropriate permissions . Please contact your system administrator if you are experiencing issues.
- Use the Assets console to navigate to the location of your content fragment.
- Open the fragment for editing, by either:
The fragment editor will open:
- Clicking/tapping on the fragment or fragment link (this is dependent on the console view).
- Selecting the fragment, then Edit from the toolbar.
- A message will be shown when the fragment is already referenced on a content page.
- The side panel can be hidden/shown using the Toggle Side Panel icon.
- Navigate through the three modes using the icons in the side panel:
- After making changes, use Save or Cancel as required.Both Save and Cancel will exit the editor - see Save, Cancel and Versions for full information on how both options operate for content fragments.
Save, Cancel and Versions
Versions can also be created, compared and reverted from the Timeline .
The editor has two options:
- SaveWill save the latest changes and exit the editor.To edit a content fragment you need the appropriate permissions . Please contact your system administrator if you are experiencing issues.It is possible to remain in the editor, making a series of changes, before selecting Save .In addition to simply saving your changes, Save also updates any references and ensures that the dispatcher is flushed as required. These changes can take time to process. Due to this, there can be a performance impact on a large/complex/heavily-loaded system.Please bear this in mind when using Save and then quickly re-entering the fragment editor to make and save further changes.
- CancelWill exit the editor without saving the latest changes.
While editing your content fragment AEM automatically creates versions to ensure that prior content can be restored if you Cancel your changes:
- When a content fragment is opened for editing AEM checks for the existence of the cookie-based token that indicates whether an editing session exists:
- If the token is found, the fragment is considered to be part of the existing editing session.
- If the token is not available and the user starts editing content, a version is created and a token for this new editing session is sent to the client, where it is saved in a cookie.
- While there is an active editing session, the content being edited is automatically saved every 600 seconds (default).The auto save interval is configurable using the /conf mechanism.Default value, see:/libs/settings/dam/cfm/jcr:content/autoSaveInterval
- If the user selects to Cancel the edit, the version created at the start of the editing session is restored and the token is removed to end the editing session.
- If the user selects to Save the edits, the updated elements/variations are persisted and the token is removed to end the editing session.
Editing the Content of your Fragment
Once you have opened your fragment, you can use the Variations tab to author your content.
Creating and Managing Variations within your Fragment
Once you have created the Master content, you can create, and manage, Variations of that content.
Associating Content with your Fragment
You can also associate content with a fragment. This provides a connection so that assets (i.e. images) can be (optionally) used with the fragment when it is added to a content page.
Viewing and Editing the Metadata (Properties) of your Fragment
You can view, and edit, the properties of a fragment using the Metadata tab.
Timeline for Content Fragments
In addition to the standard options, Timeline provides both information and actions specific to content fragments:
- View information about versions, comments, and annotations
- Actions for Versions
- Revert to this Version (select an existing fragment, then a specific version)
- Compare to Current (select an existing fragment, then a specific version)
- Add a Label and/or Comment (select an existing fragment, then a specific version)
- Save as Version (select an existing fragment, then the up arrow at the bottom of Timeline)
- Actions for Annotations
- Standard functionality for all assets
- Made in Timeline
- Related to the fragment asset
Annotations (for Content Fragments) are:
- Entered in the fragment editor
- Specific to a selected segment of text within the fragment
Comparing Fragment Versions
The Compare to Current action is available from the Timeline after you have selected a specific version.
This will open:
- the Current (latest) version (left)
- the selected version v< x.y > (right)
They will be shown side-by-side, where:
- Any differences are highlighted
- Deleted text - red
- Inserted text - green
- Replaced text - blue
- The full-screen icon allows you to open either version on its own; then toggle back to the parallel view
- You can Revert to the specific version
- Done will return you to the console
You cannot edit the fragment content when comparing fragments.
Publishing and Referencing a Fragment
If your fragment is based on a model, then you should ensure that the model has been published .
If you publish a content fragment for which the model has not yet been published, a selection list will indicate this and the model will be published with the fragment.
Content Fragments must be published for use in the publish enviroment. They can be published:
- After creation; from the Assets console.
- When you publish a page that uses the fragment ; the fragment will be listed in the page references.
After a fragment has been published and/or referenced, AEM will display a warning when an author opens the fragment for editing again. This is to warn that changes to the fragment will affect the referenced pages as well.
Deleting a Fragment
To delete a fragment:
- In the Assets console navigate to the location of the content fragment.
- Select the fragment.The Delete action is not available as a quick action.
- Select Delete from the toolbar.
- Confirm the Delete action.If the fragment is already referenced in a page you will then see a warning message and be required to confirm that you want to proceed with a Force Delete . The fragment, together with its content fragment component, will be deleted from any content pages.