Skip to main content
arjuns71585267
Level 4
Sep 26, 2018 12:22 PM UTC
Solved

is it possible to add links in template

Hi Everyone,

I tried using <a href> tag inside my HTL page to add links i my aem template and it didn't work...

Any way to create hyperlinks?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
VeenaVikraman
VeenaVikramanAccepted solution
Community Advisor
Sep 26, 2018 1:22 PM UTC

Hi Arjun

    There could be chances that HTL might have filtered thinking it as invalid link. HTL has inbuilt XSS protection. Could you please provide a sample of the link or code you were trying ?

I have tried to pull few links from the web

Adobe AEM Sightly

12 replies

VeenaVikraman
Community Advisor
VeenaVikramanCommunity AdvisorAccepted solution
Community Advisor
Sep 26, 2018 1:22 PM UTC

Hi Arjun

    There could be chances that HTL might have filtered thinking it as invalid link. HTL has inbuilt XSS protection. Could you please provide a sample of the link or code you were trying ?

I have tried to pull few links from the web

Adobe AEM Sightly

Translate
smacdonald2008
Level 10
Sep 26, 2018 1:24 PM UTC

Are you using Editable Templates - in this case - you can drop a component into an editable template that contains a link.

Translate
arjuns71585267
Level 4
Sep 26, 2018 1:40 PM UTC

Hi Donald,

I was just trying static templates for now. I want to learn to use editable templates too but it is so confusing for me now. Any way to add links in the static templates?

Translate
arjuns71585267
Level 4
Sep 26, 2018 1:41 PM UTC

Hi Veena,

It was just normal HTML A tag.

<a href="my_link_url_goes)_here">

Translate
VeenaVikraman
Community Advisor
Community Advisor
Sep 26, 2018 1:42 PM UTC

Understand that. Can you give me that link so that I can test it out ?

Translate
arjuns71585267
Level 4
Sep 26, 2018 1:44 PM UTC

just http://www.google.com

Translate
VeenaVikraman
Community Advisor
Community Advisor
Sep 26, 2018 2:08 PM UTC

I tried this and it is working fine for me

Translate
arunpatidar
Community Advisor
Community Advisor
Sep 26, 2018 2:10 PM UTC

Hi,

It works, it is just content, can you make sure you have created a tag properly.

e.g. page component HTL

<!doctype html>

<html lang="en">

    <head>

        <!--/* Initializes the Experience Manager authoring UI */-->

        <sly data-sly-include="/libs/wcm/core/components/init/init.jsp" data-sly-unwrap/>

    </head>

    <body>

        <div>This is a demo page <a href="https://www.google.co.in">Click here</a></div>

        <div data-sly-resource="${'parsys' @ resourceType='wcm/foundation/components/parsys'}"></div>

   </body>

</html>

Translate
Arun Patidar
arjuns71585267
Level 4
Sep 26, 2018 2:12 PM UTC

Is it possible to use pure html,js and css to design AEM pages rather than using Sightly along with HTML?

Translate
VeenaVikraman
Community Advisor
Community Advisor
Sep 26, 2018 2:14 PM UTC

How are you planning to render your FE content ? By content I mean the one which the business authors ?

Translate