Jayakumar
Occasional Observer

How to get the page url

I am display the data using content projection. i want to get the url and frame the json with below format,

 {
    "_id": "1992502.en_US",
    "view_href": "http://localhost;8080/de/en/caas/dxf_caas_page1.html",
    "view_image": "http://localhost:8080/de/images/behind-the-scenes/03_test_beg_dtm-test2018_053_3200x1800_res_640x360...
  }

I tried with the below script but it's not working getting empty value.,

$CMS_REF(#global.ref, abs:1, templateSet:"html")$

I will share info, if you wants further details.

Thank you

 

0 Kudos
1 Reply
hoebbel
Crownpeak employee

Hello Jayakumar,

The use of $CMS_REF(#global.ref, abs:1, templateSet: "html")$ creates an absolute link to the current page, depending on the URL creator defined within the generation action of the schedule entry. This could be e.g.
"/en/products/myPage.html"
If a "Prefix for absolute paths" is defined within the generation action of the schedule entry, this is used (before the first "/").

If you get an empty value, you should either get an error or a warning during the generation of the page or it could be caused by the URL creator.

Unfortunately, you haven't provided any context, so I can't give more than this general answer.

Annotation: If an invalid value is used for the templateSet, the attribute is ignored and the link is created for the current templateSet.

Best regards,
Holger

0 Kudos