Hi All,
Here I've created the Social Media Sharing Component using Sling Model.When I'm giving the Social media links, it is not redirected to the External app.
Any step by step process how to proceed would be really helpful.
Solved! Go to Solution.
Hi @Subashree , If the ask is just to open these links to different browser window then i think you need to add target =
"_blank" within <a href> tag like below in your HTL code.
<a href="${model.link}" target="_blank"/>
@Subashree Welcome to Experience League communities and post your concern, this is a great collaboration forum to learn.
Coming to your ask, is the component a custom component or OOTB core component? If it is OOTB core component, its right now deprecated in latest versions, but below are some reference links on how to configure it.
https://video.tv.adobe.com/v/18897?quality=12&learn=on
If it is a custom component, we may need some more details like, what version of AEM you are using, component HTL script on how the links are rendered etc?
Thank you @Shashi_Mulugu .
It is Custom Component. Here I've attached the screenshot of AEM Version and also HTL script is given below.
Kindly guide me on how to proceed.
@Subashree @ you need to use HTL context for href attribute to display link correctly.
<a href="${yourlinkedurl @ context='uri'}">Linkedin</a>
Refer to below url for more examples:
https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#121-display-context
Hi @Shashi_Mulugu ,
Here I'm giving links.It is redirecting ,but got the error attached screenshot below.
@Subashree seems like something outside AEM scope, but one last try would be show us whats present in anchor href attribute by inspecting the hyperlink? so that we can check if it is rendering what author inputs in the dialog?
When you say its not redirecting, what is the behaviour that you are seeing?
Also, when dealing with Links, you can utilize com.adobe.cq.wcm.core.components.commons.link.LinkManager API. It is used by WCM core components, thus might be capable of dealing with Internal and external links.
Hi @Subashree ,
Once you save the component, can you please inspect the link in chrome dev tool and check what is the URL being formed.
If the URL is distorted then you may need to look at your custom BE code which is forming this .
Thanks
Tarun
@Subashree Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Hi @Subashree , If the ask is just to open these links to different browser window then i think you need to add target =
"_blank" within <a href> tag like below in your HTL code.
<a href="${model.link}" target="_blank"/>
Hello @Subashree,
1) Have you tried mentioning the external domain in OSGI configs - Day Cq Link Externalizer.
Ex:- www.example.com. If you still get the issue, try using "context = 'uri' ", in the HTL href.
2) Check the console, if it is a cross-origin issue or not, if yes then check for "Adobe Granite Cross-Origin Resource Sharing Policy" OSGI config.
- Add the necessary domains to the "Allowed Origins" field, specifying the domains that are permitted to make cross-origin requests.
Hope this helps.
Views
Like
Replies
Views
Likes
Replies