Content Fragments – An Introduction

AEM 6.2 took a giant leap towards channel independent authoring by introducing Content Fragments. Now using AEM 6.2, one can author content without creating a Page. The text content is authored and managed in AEM Assets and is called a Content Fragment. Content Fragments can then be used in various channels like web pages, mobile apps, screens or campaigns.

What constitutes a Content Fragment?

A Content Fragment contains text segments and references to assets, likes images, videos, and/or fragments. They are independent of the delivery mechanism (i.e. page, channel) and can have variations of master elements to adjust fragment text according to the specific editorial or channel requirements. Think about these as content variation for various channels. I like to think of them as Responsive content!! Though Content Fragments are channel agnostic, they have a well defined content structure. One can define the structure in a Content Fragment template – structure is completely configurable.

Why should one use a Content Fragment?

As we know, in a professional setup, most of the times, content is authored by editorial staff and then it is layout by a production layout specialist. Content fragments allows authors to write content without having to worry about the layout. While writing one should write independent of the layout. In addition, one should think about how the same message gets conveyed on multiple channels – that’s all what Content Fragment authoring is all about.

Later, a Layout/Production specialist can associate the content fragment with components according to the channel and make sure the content is layout looks appealing. In addition, while binding a content fragment with the component, one can choose amongst the available content variations.

How to create a Content Fragment?

Content Fragments can be authored using AEM Assets. To create a Content Fragment, browse to the Assets Home and choose to create a Content Fragment (refer screenshot below)

 

New1.png

Next, select the template and click Next. Out of the box, AEM ships with a “Simple Fragment” template. For any meaningful Content Fragments, one will need to create a template according to one’s needs.

New2.png

Once a Content Fragment has been created, you can Edit it to author text.

new3

You shall see the WYSIWYG text editor. You can author content here.

New4.png

In addition to Rich text, you can also author content in either of the other two additional text formats supported in AEM 6.2  – a) Plain text and b) Markdown (https://en.wikipedia.org/wiki/Markdown)

How can I author Variations?

You can click on the Variations in the left hand panel and create as many variations as you want. In the screenshot below, you shall see that I have created four variations, one each for Mobile, Tablet, Screens and Web (Master).

New5.png

Each Variation can have different text.

How can I add images in the Content Fragments?

Unfortunately, AEM 6.2 doesn’t allow you to add inline images. Instead, you can add images as references. In order to do so, select “Edit” on the top left corner and select “Associated Images”.

New6.png

As the name suggests, you can associate any “Lightbox Collection”, managed in AEM Assets.

Next, we will deep dive into Content Fragment templates and see how you can create them and use them for authoring Content Fragments. I will cover that in the next Blog post.

Creating a new language site in AEM

Today, I am going back to basics and talk about something that I get asked for quite often – How to replicate an existing site in AEM in a new language.

Before we deep dive into how, let’s map a list of activities that one has to do to this procedure. As you are aware, a site in AEM is a collection of cq:pages which has components, and then text authored in those components and referenced images, videos, pdfs from DAM (Assets) etc. When we create a site, what we are essentially going to do is create copy of all of these cq:Pages, including all the references (you can choose if you wish to translate the references as well) first. Then, we will collect all the content (human readable text, images) and send those out for translation, to a translation vendor. Once everything is translated, we will import these back into our AEM site. So here is the flow:

  • Create the new language site (new path) and create a copy of the content.
  • Send out content for translation from this new path. Usually translation happens outside of AEM, unless you want to machine translate content.
  • Import back translated content.

AEM has built in functionality for managing all the three steps of the process. Let’s give it a spin.

Step1: Create new language site

Let us use Geometrixx Demo Site for this exercise. You will observe that the site is already supported in multiple languages. Let’s add a new language – Russian (ru).

  • Create language root: In order to create a language copy in a brand new language, you need to first create a dummy page, and name it as a valid ISO language code. So we will create a new page, and name it ru (ISO code for Russian).

Pic31.png

  • Please ensure that you name it “ru”. Naming it correctly is key

Pic32.png

  • Once the page has been created, we will go back and select the source (we are just going to select “Products” for illustration) and open References panel and select language copy

Pic33.png

  • The Language copies shows all the languages in which “Product” page exists. Please note, it does not care about what is under that specific page though.
  • Next we will access the “Create Language” option to create “Products” in Russian. To do so select “Russian” from the list of languages. The drop down shows a list of languages that are configured for the site, in which the selected source page doesn’t exist. If you want to create a site in a new language, and don’t see the language in the drop down, first go and add a new language root. As soon as you add a language root, it will start appearing in the drop down.

pic34

  • Next, we can choose if we wish to just create the structure or send the content out for translation as well. There are three options:
    • Create structure, in which case Products page including all sub-pages will be copied over to Russian branch.
    • Create new Translation Project, in this case the content is copied over and additionally sent out for translation as well. For sending out content, we create a Translation Project, which is a special kind of an AEM Project.
    • Add to existing Translation Project, in this scenario, the content is copied over and is added to an existing Translation Project.

In our case, we are going to create a new Translation Project. Let’s call it “Products-russian”

Pic35.png

Send content for Translation

Now that we have created the language copy, as well as created the Project, we will go ahead and send the content out for translation.

  • As first steps, we will go to AEM Projects and open up the Products-russian Project

Pic36.png

  • When you open the Project, you shall see sections – a) Translation Summary, b) Translation job, c) Tasks and d) The Team.

Pic37.png

  • Translation Summary is where you will set all the translation properties. Be default, AEM ships with “Microsoft Translator” machine translation connector. You can click on the three dots at the bottom and look all the Properties and change them as well.

Pic38.png

  • Translation Job lists all the content that will be sent out for translation. You can add or delete content in this section.

Pic39.png

  • Tasks and Team can be configured as well – I shall cover them in a separate post.
  • In order to send out content for translation, click on the Translation Job, and select “Start”. The process is completely automated and the content will be sent out for translation.

Pic40.png

Import Content back for Translation

The import is completely seamless and integrated. When the content has been translated at the translator end, it comes back in AEM automatically. You will see the Status of the Translation Job change from “Committed for Translation” to “Ready for Review”.