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

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

Avatar

Level 1

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

 

1 Accepted Solution

Avatar

Correct answer by
Level 6

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

View solution in original post

2 Replies

Avatar

Correct answer by
Level 6

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

Avatar

Community Advisor

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.