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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AEM get livecopy path from js-use-api (HTL JavaScript)


Level 1

I have a question about js-use-api (HTL JavaScript)

I have a page called product/en/index.html, in this page I want to get livecopy path from spesific path.

I already have the livecopy page, here is the detail:

Blueprint Page : /content/project/product/en/help.html

Livecopy Page : /content/project/product/uk/contact/help.html

Let's say I have the blueprint path, how can I get the livecopy path of that blueprint using HTL JavaScript?

I have try below code but not working,

"use strict";

use(function () {

    var data = {}

    var thePage = "/content/project/product/en/help";

    data.livecopyPath = currentPage.getLiveCopy(thePage).getPath();

    return data;


Please help

4 Replies


Level 10

I do not think you can use JS to get this type of information - you would need to use the Strongly types API:

"The Adobe AEM Quickstart and Web Application."

So to hook this API into an HTL component - you should use SLing Model - not JS HTL.


Level 1

thanks smacdonald2008​, sorry for late reply

I have been reserach and as smacdonald2008​ say in doc "The Adobe AEM Quickstart and Web Application." 

we use this code and it's worked

request.resourceResolver.adaptTo( and get via function getLiveRelationships(resour,null,null)

var the_page = "live-copy-path";

    var resour = resource.getResourceResolver().getResource(the_page);

var livecopy = request.resourceResolver.adaptTo(,null,null);

      while (livecopy.hasNext()) {

            var page =;

            data.blueprint = page.getTargetPath();