Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Why characters like “\\n” are appearing in page json.

Avatar

Level 7

Hi

 

Why escape characters like “\n” are appearing in page json. What are such characters may appear in page json also

how to get original content of page. Please refer the attached screenshot for reference.

 

 

 

 

akshaybhujbale_2-1667983961887.pngakshaybhujbale_3-1667983967385.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @akshaybhujbale,

In general all looks to work as expected. Please be aware that what you can see on this view

cf-ref-content.jpg

It is not content that is part of this specific page it is content of following CF /content/dam/we-retail/en/experiences/arctic-surfing-in-lofoten/arctic-surfing-in-lofoten which is referenced on the page via Content Fragment component.

Moving on, what you can see using json renderer is exactly what is in repository:

json-strucutre.jpg

crx-structure.jpg

Knowing both above things, it is not possible to get referenced content using json renderer, it will only show path to referred node (CF, XF, Page etc).

Regarding \n this is part of content that you can find under text property - if you will copy value of this property into some text editor you will see some new lines as well (of course /n will be replaced by text editor with new lines). In other words \n is part of the content so this is why you can see it - if you will edit text property an paste it without new lines it will also gone from json.

One last important aspect what you see on page is not what is part of text property - despite the fact it stores very similar data like CF.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @akshaybhujbale,

In general all looks to work as expected. Please be aware that what you can see on this view

cf-ref-content.jpg

It is not content that is part of this specific page it is content of following CF /content/dam/we-retail/en/experiences/arctic-surfing-in-lofoten/arctic-surfing-in-lofoten which is referenced on the page via Content Fragment component.

Moving on, what you can see using json renderer is exactly what is in repository:

json-strucutre.jpg

crx-structure.jpg

Knowing both above things, it is not possible to get referenced content using json renderer, it will only show path to referred node (CF, XF, Page etc).

Regarding \n this is part of content that you can find under text property - if you will copy value of this property into some text editor you will see some new lines as well (of course /n will be replaced by text editor with new lines). In other words \n is part of the content so this is why you can see it - if you will edit text property an paste it without new lines it will also gone from json.

One last important aspect what you see on page is not what is part of text property - despite the fact it stores very similar data like CF.

Avatar

Level 7

@lukasz-m 

How to get the same content that I get from text property but without "\n"?