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

SOLVED

AuthorLink: How to generate a link to directly edit the page?

Avatar

Level 5

Hi

Is there a way one can generate a link to directly edit a page in AEM? I need to include this link in an email that I send out from a component.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can construct the AEM url in the sling model and use the same while sending email.

1. First get the current page path using Page object.

@inject

private Page currentPage; 

2. Use Externalizer to get the hostname and the construct complete url ("<hostname>" + "/editor.html/+"<Page path>"+"html"

you can check below example to get hostname info. 

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/externalizer.html?... 

 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

You can construct the AEM url in the sling model and use the same while sending email.

1. First get the current page path using Page object.

@inject

private Page currentPage; 

2. Use Externalizer to get the hostname and the construct complete url ("<hostname>" + "/editor.html/+"<Page path>"+"html"

you can check below example to get hostname info. 

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/externalizer.html?...