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

@ format in sightly working differently in AEM 6.1 and AEM 6.3

Avatar

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
premchandr61956
Level 3

11-01-2018

Hi,

We have a component where for creating multiple tabs on the page which has code snippet as below.

<div data-sly-resource="${tab.token @ format=[itemList.index], resourceType='foundation/components/parsys'}"></div>

The "tab.token" will be a value that we give in the component dialog as tab name, for example, tab1 and tab2. The above code appends an index 0,1 and so on for each node created in AEM 6.3 but doesn't add the index in AEM 6.1.

This issue is reproducible in AEM 6.3 SP1 CFP1.

Thanks,

Prem

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

11-01-2018

First - for syntax issues with HTL - check with the HTL Spec here -- htl-spec/SPECIFICATION.md at master · Adobe-Marketing-Cloud/htl-spec · GitHub

Are you trying to build a multi-tab component in the web page with HTL?

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

11-01-2018

Two questions:

1. What you want expected output to be.

2. You are seeing in issue in 6.3 or 6.1 ( I am not clear on last statement "The above code appends an index 0,1 and so on for each node created in AEM 6.3 but doesn't add the index in AEM 6.1.")

Avatar

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
premchandr61956
Level 3

11-01-2018

Yes the above code doesn't add index values to node in 6.3 but nor in 6.1

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

11-01-2018

What output are you trying to do. Typically, a collection when working with HTL is built in a WCMUse POJO or Sling Model Java class and then displayed in HTL.

Avatar

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
premchandr61956
Level 3

11-01-2018

We are using the above line of code to add an index dynamically to the names for tabs, for example, written_by0, written_by1, and written_by2 in order to avoid duplication of the same node and so on. This did not work in our 6.1 environments so we just had dialog validation restricting authors to avoid duplication but then we did not remove this code to append "@ format= {itemList.index}" for the node name.

But when compared to 6.3 we are not able to fetch content from the node written-by because the above code is looking for the content under written_by0. While debugging we found that the same code which did not add index value to node name in AEM 6.1 is adding index now in 6.3. Is this bug with AEM 6.1 or 6.3 and after referring to sightly documents @format will replace "formatting pattern string " but in the line of code that the copied doesn't contain any formatting pattern string like below

<div data-sly-resource="${tab.token{0} @ format=[itemList.index]}

Avatar

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
premchandr61956
Level 3

Likes

17 likes

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
premchandr61956
Level 3

11-01-2018

When I cheked with one of my collegue who is also using AEM 6.3 CFP2 he doesn't see index value added at the end of node name. My instance is AEM 6.3 SP1 CFP1.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

11-01-2018

" Is this bug with AEM 6.1 or 6.3 and after referring to sightly documents @format will replace "formatting pattern string " but in the line of code that the copied doesn't contain any formatting pattern string like below"

Please open a support ticket as this does look like a bug as its not behaving as documented.

Avatar

Avatar
Give Back
Level 1
abhisheks422283
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
View profile

Avatar
Give Back
Level 1
abhisheks422283
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Give Back
View profile
abhisheks422283
Level 1

08-02-2018

<sly data-sly-test.parResource="${'par{0}' @format=[itemList.index]}"></sly>

This is working fine in AEM 6.3 SP1-CFP2

Thanks.

Abhishek