1

I am trying to access Sitecore 10.1 item via layout services and it is working fine with GUID and full path. But when I am trying to access it via a relative path from the current app, it is not working. like https://cm.myproject.localhost/sitecore/api/layout/render/jss?sc_site=MyProject&sc_apikey=06d43b65-6732-46b2-becd-ce047675df71&item=/CustomHome&sc_lang=en.

However, it is working fine with this full item path like https://cm.myproject.localhost/sitecore/api/layout/render/jss?sc_site=MyProject&sc_apikey=06d43b65-6732-46b2-becd-ce047675df71&item=/sitecore/content/MyProject/CustomHome&sc_lang=en

4
  • Is it a home page, it should be accessible by ‘/‘ only Mar 1, 2021 at 8:57
  • No. It is not home page. Yes home page can be accessed with simple / but i want to access other pages. Mar 1, 2021 at 9:43
  • you says that you can't access the following item: /CustomHome. But based on the full path item=/sitecore/content/MyProject/CustomHome, it look like this item is a site start item which will be accessible by / only. If I am wrong with my assumption, just add more details which item is a start item (let's say home) for your site, and whose other items you can't access Mar 1, 2021 at 11:38
  • No. the Start item is a home item and it is being accessed correctly with /. /CustomHome item is a different item than home and I want to access it with a layout service call. Mar 1, 2021 at 12:24

1 Answer 1

2

We have discussed the issue in a private chat and figured out, that the /CustomHome item are placed on the same level with a site start item which makes it impossible to resolved by relative path. In general, Layout Service item resolving process looks similar with an original item resolving: 1) Sitecore sites are resolved based on hostname or sc_site query string; 2) start item path (which is usually home page) is calculated based on the site configuration: siteRoot + startItem 3) the requested item is resolved based on the start item path + value from the item query string. If requested item is not under the site start item, it will be impossible to get it by relative path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.