Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Publishing XML Content to AEM Sites - Want to use existing AEM Sites template?

Avatar

Avatar
Give Back 5
Employee
DivrajSingh
Employee

Likes

8 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Ignite 5
Boost 5
Boost 3
Ignite 3
View profile

Avatar
Give Back 5
Employee
DivrajSingh
Employee

Likes

8 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Ignite 5
Boost 5
Boost 3
Ignite 3
View profile
DivrajSingh
Employee

24-05-2021

Problem Statement

You are using XML Documentation to author XML/DITA content and one of the publish output is AEM Sites.
You want to use an existing AEM Sites template in order to use the pre-designed header/footer (branding, styles etc.) used on your marketing or end user portal (instead of out-of-the-box templates that comes with XML Documentation)
For reference, lets take an example of we-retail website (AEM sample site) that has an already defined design. The left picture is an out-of-the-box template from XML Documentation, the right one is same content but using AEM's we-retail editable template.

DivrajSingh_7-1621866685971.png

 

This article will give details on how you can make use of existing AEM Sites templates to publish DITA/XML content

 

Some understanding towards the solution

In this article:

  • We will demonstrate use of we-retail template - an editable template (see additional resources for more details), so its assumed that your existing template is an editable template or you are aware of constructs of editable template
  • We will also refer to the DITAMap dashboard which is a publishing interface for DITA content in XML Documentation, from where we will change the AEM Site template. Refer below screenshot, which shows the default configuration where it uses the out-of-the-box configuration "/libs/fmdita/config/template/default"

DivrajSingh_2-1621864631321.png

 

 

Steps to configure and use existing AEM Sites template for XML/DITA content output

Step 1: Create a template configuration that points to your existing template, lets assume you created this at path "/apps/dita-demo/config/templates/weretail-techdocs". The configuration should have following properties:

  • topicPageTemplate: the template that will be used by the DITA content on AEM Sites output. So this should point to the existing template which in our case will be "/conf/we-retail/settings/wcm/templates/experience-page"
  • topicHeadNode: Specify the location of the node that will contain the head values (or metadata) derived from the DITA content. Path is relative to "topicPageTemplate"
  • topicContentNode: Specify the location of the node that will contain the DITA content in a topic page. Path is relative to "topicPageTemplate"

The above properties are key drivers to adapt to the custom AEM sites template. The other properties shown in the screenshot below can be defined on need basis - those are also detailed out in section "Customize design template for generating output" of Installation and Configuration Guide of XML Documentation

DivrajSingh_3-1621864902495.png

 

With above settings, you are not creating any new template but just creating a configuration that points to an existing AEM Sites template. This configuration is used by DITAMap to pubilsh the DITA content to AEM Sites output.

 

You can download above configuration using link provided in the "Sample Configuration" section at the bottom of this article

 

Step 2: Point the DITAMap to the new configuration

  • Open the DITAMap dashboard for the DITAMap, Edit/Create a preset (AEM Site) to point to new template configuration we created, refer screenshot below, where the "Design" field now points to the new configuration "/apps/dita-demo/config/templates/weretail-techdocs" that was just created:

DivrajSingh_6-1621865154256.png

 

  • Save and generate the output to test, you should see an output like below

DivrajSingh_5-1621865065206.png

 

 

Sample Configuration

The configuration created in Step 2 can also be installed using the package which is available for download here

 

 

Additional Resources
Read more about Editable Templates

 

 

Similar Upcoming Articles 

We will be publishing articles on:

  • How to customize DITA/XML content components used in AEM Sites output
  • Configuration options for nodes under AEM Sites output (nodes that are created by XML Documentation publisher)

These will be updated with links once the articles are ready.

Custom AEM Sites Template DITA to AEM Sites output

Replies

Avatar

Avatar
Give Back 3
Level 1
Apmag
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
View profile

Avatar
Give Back 3
Level 1
Apmag
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
View profile
Apmag
Level 1

yesterday

Hi ,

How to consider the path for topicContentNode and topicHeadNode?

also above properties are mandatory ? 

 

Thanks in advance.

 

Avatar

Avatar
Give Back 5
Employee
DivrajSingh
Employee

Likes

8 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Ignite 5
Boost 5
Boost 3
Ignite 3
View profile

Avatar
Give Back 5
Employee
DivrajSingh
Employee

Likes

8 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Ignite 5
Boost 5
Boost 3
Ignite 3
View profile
DivrajSingh
Employee

yesterday

These paths are the nodes under the generated page where the content of topic and topic head gets generated. Following description is the snippet from Installation and configuration guide:

 

DivrajSingh_0-1623697193392.png

 

These two properties are mandatory - or else the DITA content will not be added to the generated page.

 

Avatar

Avatar
Give Back 3
Level 1
Apmag
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
View profile

Avatar
Give Back 3
Level 1
Apmag
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
View profile
Apmag
Level 1

53m ago

Thanks for your information.

 

I have tried but not reflecting header and footer.

 

What are preconditions for editable template?

Like only Header and Footer should be added in IntialContent of editable template and reaming content should add on page- template should be like this

can you suggest how exactly the template should be?

 

Created editable template and authored the Text Component( for Header/Footer) in IntialContent and same template configured -/apps/fmdita/config/templates/xxx-dita-content) topicPageTemplate. but not working -not reflecting this header and footer after generate AEM sites-.

 

can  you please suggest and thanks in advance.

Avatar

Avatar
Give Back 3
Level 1
Apmag
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
View profile

Avatar
Give Back 3
Level 1
Apmag
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Give Back 3
Give Back
View profile
Apmag
Level 1

43m ago

HI DivrajSingh,

I applied this path  "/apps/fmdita/config/templates/xxx-dita-content" in design while AEM-sites generates.

 

Thanks in advance