AEM Sling Vanity, Add prefix path to the stored value | Community
Skip to main content
karthikb1706130
February 2, 2021
Solved

AEM Sling Vanity, Add prefix path to the stored value

  • February 2, 2021
  • 1 reply
  • 1053 views

I have two sites for example

/content

------siteA

------siteB

whenever an author authors the sling vanity property for a particular page under site A, I want to append /siteA/ as a prefix to the value stored, similarly when an author authors vanity property under siteB, I need to append /siteB/ as a prefix to the value stored.
I came to know what we can achieve it using vanity-root tenant conf but could not find any documentation anywhere. 

Any suggestions on how to achieve this.

 

Thanks in Advance!!

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 Sanket_Kumbharkhane

Hi @karthikb1706130,

You can refer to the steps needed to add and configure the Vanity Path Rewrite Mapper,

please visit https://adobe-consulting-services.github.io/acs-aem-commons/features/vanity-path-rewrite-mapper/index.html

 

Or

You can write a helper class using wcmuse or sling model and add it to your base template. So, whenever the author edits the vanity Url and saves the page, the request goes to the helper class. In helper class, you can read the value of vanity Url, append Sitename as prefix and write it back. 

Note: This is strictly for Author environment

1 reply

Sanket_Kumbharkhane
Sanket_KumbharkhaneAccepted solution
Level 4
February 2, 2021

Hi @karthikb1706130,

You can refer to the steps needed to add and configure the Vanity Path Rewrite Mapper,

please visit https://adobe-consulting-services.github.io/acs-aem-commons/features/vanity-path-rewrite-mapper/index.html

 

Or

You can write a helper class using wcmuse or sling model and add it to your base template. So, whenever the author edits the vanity Url and saves the page, the request goes to the helper class. In helper class, you can read the value of vanity Url, append Sitename as prefix and write it back. 

Note: This is strictly for Author environment