Expand my Community achievements bar.

SOLVED

AEM Sling Vanity, Add prefix path to the stored value

Avatar

Level 1

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!!

1 Accepted Solution

Avatar

Correct answer by
Level 4

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/inde...

 

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

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

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/inde...

 

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