Expand my Community achievements bar.

SOLVED

When AEM auto-generates IDs for elements, can you specify the element <title> in the "pattern for generating IDs field"?

Avatar

Level 2

In my DITA XML docs, I want elements that have an auto-generated unique ID, but I also want the IDs to follow a format/pattern of  element<title>, followed by element name, and unique generated ID number (eg. <fig id="Toaster-Oven_fig_2">).

When configuring element id patterns in the Adobe Experience Manager Web Console Configuration page, can you specify the element <title> in the "pattern for generating IDs field"? The pattern is ${elementName}_${id}. Is it possible to specify the pattern: ${title}_{elementName}_${id}?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @davidl38471046 

 

This question is specific to DITA implementation. Requesting you to please raise under Experience Manager Guides - Adobe Experience League Community

 

You might be able to get quicker response there


Aanchal Sikka

View solution in original post

2 Replies

Avatar

Community Advisor

did you try writing a Sling model to generate ID in your pattern and include in HTL like below

 

sling model:

 

@Model(adaptables = Resource.class)
public class IDDModel {

private static int counter = 0;

public String getDynamicId() {
return "elementID_" + counter++;
}
}

 

<div data-sly-use.myModel="com.myproject.MyModel" id="${myModel.dynamicId}">
<!-- Component content -->
</div>

Avatar

Correct answer by
Community Advisor

Hello @davidl38471046 

 

This question is specific to DITA implementation. Requesting you to please raise under Experience Manager Guides - Adobe Experience League Community

 

You might be able to get quicker response there


Aanchal Sikka