Page with a redirect (page properties) opens the redirected page in the AEM touch editor and not the actual page | Community
Skip to main content
January 26, 2022
Solved

Page with a redirect (page properties) opens the redirected page in the AEM touch editor and not the actual page

  • January 26, 2022
  • 2 replies
  • 1908 views

Hello,

 

We noticed that when a page has a redirect set viap page properties) and you try to edit the page in AEM you will see that the targeted page opens and not the actual page you want to edit in the structure. 

 

Is this a feature added in a recent service pack? I could not find anything in the release notes for this. Is there a way to open the actual page without having to remove the redirect in the page properties first?

 

Thanks

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JeevanRaj

Hi @j_verschueren 

 

This behaviour exists for the core page component. I'm not sure what is the behaviour in case of foundation page component. However if you want to change this behaviour you can overlay the redirect.html or change the condition how it is called in page.html (/apps/core/wcm/components/page/v2/page/page.html).

 

Below is the condition that is currently present in core v2 page component.

<sly data-sly-test.isRedirectPage="${page.redirectTarget && (wcmmode.edit || wcmmode.preview)}"
data-sly-call="${redirect.redirect @ redirectTarget = page.redirectTarget}"></sly>
<sly data-sly-test="${!isRedirectPage}">
<sly data-sly-include="body.skiptomaincontent.html"></sly>
<sly data-sly-include="body.socialmedia_begin.html"></sly>
<sly data-sly-include="body.html"></sly>
<sly data-sly-call="${footer.footer @ page = page, pwa = pwa}"></sly>
<sly data-sly-include="body.socialmedia_end.html"></sly>
</sly> 

 Thanks

2 replies

JeevanRaj
Community Advisor
JeevanRajCommunity AdvisorAccepted solution
Community Advisor
January 26, 2022

Hi @j_verschueren 

 

This behaviour exists for the core page component. I'm not sure what is the behaviour in case of foundation page component. However if you want to change this behaviour you can overlay the redirect.html or change the condition how it is called in page.html (/apps/core/wcm/components/page/v2/page/page.html).

 

Below is the condition that is currently present in core v2 page component.

<sly data-sly-test.isRedirectPage="${page.redirectTarget && (wcmmode.edit || wcmmode.preview)}"
data-sly-call="${redirect.redirect @ redirectTarget = page.redirectTarget}"></sly>
<sly data-sly-test="${!isRedirectPage}">
<sly data-sly-include="body.skiptomaincontent.html"></sly>
<sly data-sly-include="body.socialmedia_begin.html"></sly>
<sly data-sly-include="body.html"></sly>
<sly data-sly-call="${footer.footer @ page = page, pwa = pwa}"></sly>
<sly data-sly-include="body.socialmedia_end.html"></sly>
</sly> 

 Thanks

milind_bachani
Adobe Employee
Adobe Employee
January 26, 2022

Hi @j_verschueren ,

You can explicitly stop the redirection by adding the condition if the wcmmode is edit or preview and I think the code given by @jeevanraj should work in that case.

 

Thanks.