Get page description from page url | Community
Skip to main content
Level 3
September 20, 2021
Solved

Get page description from page url

  • September 20, 2021
  • 2 replies
  • 1048 views

Hello,

I have a list of page url-s. For each of them I have to get the page description. Is there any ready API to send the page url from JS in order to get the page description? Or should I create an API? Thanks! 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Fanindra_Surat

Hi @ad-engineer -

 

I assume, you are referring to the description stored on the page in jcr:content node.

If yes, you can retrieve it in javascript by accessing the path over HTTP or Ajax call in the format %page_path%/jcr:content.json.

Ex: /content/we-retail/language-masters/en/men/jcr:content.json for the page content/we-retail/language-masters/en/men.html

 

This gives the completed information present on the node along with description in json format.

 

Thanks,

Fani

2 replies

Fanindra_Surat
Community Advisor
Fanindra_SuratCommunity AdvisorAccepted solution
Community Advisor
September 20, 2021

Hi @ad-engineer -

 

I assume, you are referring to the description stored on the page in jcr:content node.

If yes, you can retrieve it in javascript by accessing the path over HTTP or Ajax call in the format %page_path%/jcr:content.json.

Ex: /content/we-retail/language-masters/en/men/jcr:content.json for the page content/we-retail/language-masters/en/men.html

 

This gives the completed information present on the node along with description in json format.

 

Thanks,

Fani

arunpatidar
Community Advisor
Community Advisor
September 20, 2021

I think you should reconsider the implementation, instead of return just path from list, return the title, description etc as an object and reuse it.

If it is not possible then you should consider creating a dedicated api. You should not be using OOTB json, which leads into security vulnerability if .json is not unblocked for all the request.

Arun Patidar