links transformation | Community
Skip to main content
sreedobe
Level 4
July 16, 2020
Solved

links transformation

  • July 16, 2020
  • 1 reply
  • 2439 views

Hi All,

 

I got following use case and looking for options as well clarity on sling rewrite transformer factory, transformer.

 

mobile app will access AEM site urls with a query parameter "mobile=true" and header, footer needs to be hidden.

 

options:

1. append query param "mobile=true" to all anchor elements hrefs

2. use sling rewrite transformer factory, transformer to transform all anchor urls.

3. store a cookie on first request and if cookie exists or url has query param - hide header, footer

 

Question: If I go in transformer route, does it transform only content urls that exists or does it transform all internal, external urls ?

 

thanks.

Sri

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 arunpatidar

Hi,

Why don't you use css to hide or javascript to hide/delete header/footer on page load. It will be easy, maintainable and client side.

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 17, 2020

Hi,

Why don't you use css to hide or javascript to hide/delete header/footer on page load. It will be easy, maintainable and client side.

Arun Patidar
sreedobe
sreedobeAuthor
Level 4
July 17, 2020

@arunpatidar example helps and appreciated. But, I wanted only /content links to have selector. As I do not want to control other than aem content pages.