Rethinking Content for Fluid Experiences
Table of Contents
The lab overview should give the attendee a general idea of what this lab is focused on and how they might use the information within to gain additional value from their Adobe solutions. This section should include:
- Identify use cases to choose between Experience Fragments & Content Fragments.
- Determine site structure for content fragments & Experience Fragments.
- Use AEM as Headless Content Management System.
- Using Content Fragments and Experience Fragments with Multi-lingual sites.
Lesson 1 Content Fragments
- Determine usage of content fragments.
- Create content fragment models.
- Create content fragments using content fragment model.
- Add variations in content fragments.
In this lesson, we will learn usage and benefits of content fragments in AEM. We will create content fragment using content fragment models. We will also explore variation and few other features of content fragments.
Exercise 1.1 - Content Fragment Model
In this exercise, we will create initial Content Fragment Model.
Go to AEM > Tools > Assets > Content Fragment Models.
Double click to open We.Retail folder.
Press Create button to create a model
Provide model details:
- Model Title : Article
- Description : Content Fragment Model for Articles in We.Retail (optional)
Press Create Button and you should get a success message.
Press Open button in success message.
Exercise 1.2 - Editing Content Fragment Model
In this exercise, we will add fields to the Article Content Fragment Model.
- On your screen, you should see Content Fragment Model Editor . It is divided into two sections, left-one is canvas where will add fields and on the other side we have Data Type lists which show us list of all data types which can be added to content fragments.
- Click on Single line text data type and drag it on canvas to add it.
- Go to Properties tab and add following details:
- Field Label: Article Title
- Property Name: articleTitle (required field)
- Placeholder: Enter Article Title
- Required: Checked
Add another Single line text to the canvas with following properties:
- Field Label: Article Author
- Property Name: articleAuthor (required field)
- Placeholder: Enter Article Author Name
- Required: Unchecked
Add Multi line text to the canvas with following properties:
- Field Label: Article Body
- Property Name: articleBody (required field)
- Click the Save button to complete the creation of the Article Content Fragment Model.
Exercise 1.3 - Create Content Fragment
Now we have content fragment model and we will use it to create content fragment.
Go to AEM > Assets > Files > We.Retail > English.
Create a folder by pressing Create button and provide title as CF.
Open CF folder.
Press Create Button > Content Fragment . You should see a list of available content fragments.
Click on Article template or content fragment model and Press Next button.
Provide title for the content fragment as North Slope Adventures.
Click the Create button and you should get Success Message. Click the Open button in the success message modal-window.
Now you should see a form with all data types we provided in article content fragment model. In this exercise, we will be adding content to the content fragment Model
- Add following content to this article:
- Article Title: North Slope Adventure
- Article Author: Your Name or Any name
- Article Body: Text from file
- Click the Save button to save this article.
Exercise 1.4 - Create content fragment variations
As a content owner, we also want to create content fragment variations for other channels and requirements.
- Select recently created content fragment.
- Select Edit or Press E on your keyboard to Edit Content Fragment.
- Press Create Variation to create new variation of the content fragment.
- Provide the Title as Summary and click Add.
We will be using OOTB summarization feature for content fragments to summarize the article.
Click in Article Body box and select maximize icon
In maximize window, Press Summarize Text Button
Provide Target words as 200.
Review the summarized results and Press Summarize Button to confirm final Summarization.
Select the text area and press the minimize icon.
Click the Save button to save summary.
Lesson 2 Experience Fragments
- Determine usage of Experience Fragments.
- Differentiate between Experience Fragments & Content Fragments.
Experience Fragments allows content authors to reuse content across channels including sites pages and 3rd party systems.
Exercise 2.1 - Create Experience Fragments
Go to AEM Navigation > Experience Fragments.
Create two folders for languages with following titles:
Select the en folder and click Create > Experience Fragments. This will list OOTB templates for Experience Fragment Creation.
Experience Fragment templates are like Page Templates.
Select ** We.Retail Experience Fragment Web Variation** template.
Click the Next button and provide Title of experience fragment as Adventure in North Slope.
Click the Create button and Press Open in success message.
You should see an Experience Fragment Page Editor, it is quite similar to AEM Page Editor.
Add following components to the Layout Container :
- Title Component
- Image Component
- Content Fragment Component
Resize Image Component and Content fragment to get them in same row.
Now add an image to image component.
In Asset browser, filter the list by Content Fragment.
Now drag the content fragment on the content fragment component within the page.
Double click to open dialog box of content fragment.
Configure Content Fragment Dialog box:
- Display Mode: Single Text Element
- Element: Article Body
- In the Paragraph Tab, Select Range Radio Button and provide input as 2-3. This determines to show only second to third paragraphs.
- Press check or done button to save changes.
Exercise 2.2 - Add Experience Fragment to the Page.
- Go to AEM > Sites > We.Retail > Language Masters > English
- Press Create Button > Select Page
- Select Content Page Template
- Provide Title as Adventure
- Press Create > Open
- Add Experience Fragment Component on the page
- Filter asset browser by Experience Fragments and drag and drop Adventures in North Slope experience fragment over Experience Fragment Component.
- You may add few more components on page like images to display products regarding adventure. .
Lesson 3 AEM as Headless CMS
- Leverage AEM As Headless CMS.
- Use Content Fragment to generate JSON respon.
You may want to leverage content inside AEM in third-party applications as well. With content-fragments you don't need to duplicate the content.
Exercise 3.1 - Content Fragment as JSON
Go to AEM > Assets > Files > We-Retail > En > CF.
Select to edit the content fragment.
Change the URL as following:
Or click http://localhost:4502/api/assets/we-retail/en/experiences/arctic-surfing-in-lofoten.json
You should get JSON response as following
This json can be accessed by any third-party app for content rendering. Also when content author changes the content, Third-party apps will recieve the latest content.
Exercise 3.2 - Experience Fragment as JSON
You can export Experience Fragment to target as JSON. This will help in using Experience Fragment on SPA sites or other channels target by Adobe Target.
- Go to AEM > Experience Fragments > En.
- Select En folder and choose properties.
- Click on Cloud Services.
- In Cloud Service Configurations dropdown ,select Adobe Target configuration.
- Now you can to choose ** Adobe Target Export Format **:
- Save and Close.
- Select the Experience Fragment created in previous lesson.
- Click the Export to Target button in action.
- You should get Success Message.
Now this experience fragment will be available in Adobe Target for usage.
Lesson 4 AEM with Multi-Site Management
- Using Content Fragment For MSM.
- Using Experience Fragment For MSM.
You may leverage experience fragments and content fragments for multi-site management.
Exercise 4.1 - Configure Translation Editor
- Go to AEM > Tools > Translation Configuration.
- Select /content/dam/ and Press Edit from action toolbar.
- Click General to open list of properties.
- In New Property textfield , enter articleTitle, articleAuthor & articleBody.
- Press the Save button.
Exercise 4.2 - Create Translation Project
- Go to AEM > Sites > We.Retail > Language Masters > English.
- Checked Select Adventure Page.
- Select References in sidebar.
- Click on Create & Translate Action on bottom of side bar.
- Select German in Languages drop down.
- Select Create Translation Projects in Project.
- Provide Title as Adventure Page Translation.
- Press the Create Button.
Exercise 4.3 - Run Translation Project
- Go to AEM > Project > Adventure Page Translation.
- Double click to open the project.
- Click on arrow icon in translation job card and start the translation.
- Click on three dots in translation job card and accept the translation.
- Now go to AEM > Sites > We.Retail > Language Masters > Deutch.
- You should see a german page for Adventure page with translated content fragment and Experience Fragments.
Try to access content fragment in your third party application.
AEM Fluid Experiences for headless usecases
AEM Content Fragement
[Translating Content Fragments] (https://helpx.adobe.com/in/experience-manager/6-4/assets/using/creating-translation-projects-for-content-fragments.html)
[Experience Fragments Vs Content Fragment] (https://helpx.adobe.com/experience-manager/kt/platform-repository/using/content-fragments-experience-fragments-article-understand.html)