Fetch aem url with editor.html in JS

Avatar

Avatar

kishorek1264980

Avatar

kishorek1264980

kishorek1264980

12-09-2019

how to fetch a aem complete url with editor.html or cf# in javascript. When i used javascript/jquery methods to fetch a url, editor.html or cf# is not coming.

For eg: In localhost:4502/editor.html/content/sample if i use window.location.href or any other js methods

it is returning only location:4502/content/sample.

Replies

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.1K

Correct Reply

839

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.1K

Correct Reply

839
Arun_Patidar
MVP

12-09-2019

for touch UI, you can use below:

"/"+Granite.author.EditorFrame.editorVanityURL+Granite.author.page.path+".html"

/editor.html/content/AEM63App/fr.html

Screenshot 2019-09-12 at 5.26.48 PM.png

Avatar

Avatar

kishorek1264980

Avatar

kishorek1264980

kishorek1264980

12-09-2019

it is coming in console but if i use it in js file it is showing as undefined.

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.1K

Correct Reply

839

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.1K

Correct Reply

839
Arun_Patidar
MVP

13-09-2019

Where are you writing code. Inside sites js or dialog js?

If you need editor page when editing then create js with cq.authoring.dialog category.