Hi All,
We are facing an issue when their is a personalized container which have fixed list component configured inside it and it has the list of pages selected.
Now out of them one page which is selected by the author have an alias configured on it.
Now when the component is rendered on the publish \ dispatcher URL the one which had alias show the incorrect domain and the other which doesn't have the alias points to correct domain.
This is happening when their is a combination of aliases and the personalisation container.
As a workaround we removed the alias from the page but any help on how to resolve this issue will be appreciated.
Regards,
Shikha
Views
Replies
Total Likes
Hi @sharms13
If I understand this issue correctly:
Please let me know if I understood the issue correctly and then I might be able to help you.
Thanks!
Views
Replies
Total Likes
@sharms13 @nitinfuture
When we will use sling:alias for any of the page content, sling:alias will always take precedence over the page path and will always resolve as a link for any of the resource.
So let's say you have a page as /content/xyz/en_us/about.html which is served as www.abc.com/about and you have a sling:alias as about_new for it, then it will start resolving as www.abc.com/about_new.
Having said that both the resource will be serving the same content i.e about.html contnet.
What I understood is this is not wokring in this case here and now to make this work we will need to use the Resource Resolver Mapping.
You can use the below method to map the resource by passing the incoming URL into the map() and it will give the shortened URL with sling:mapping path in your component.
resourceResolver.map(sourceURL);
Rewriter configuration:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
contentTypes="[text/html]"
enabled="{Boolean}true"
generatorType="htmlparser"
order="1"
paths="[/content/abc/]"
serializerType="htmlwriter"
transformerTypes="[linkchecker,versioned-clientlibs,resourceresolver-map]">
<generator-htmlparser
jcr:primaryType="nt:unstructured"
component-optional="{Boolean}true"
includeTags="[A,/A,IMG,SOURCE,/SOURCE,LINK,SCRIPT,FORM]"/>
</jcr:root>
Also ensure that you have the link rewriter configured with the path such as /content/xyz/en_us which will shorten the URL and map it with etc/maps that is configured for the brand and it will resolve the binding of other domain into URL.
Please refer the link below:
https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html
Thanks!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies