Expand my Community achievements bar.

SOLVED

Google map implementation in Sightly

Avatar

Level 2

Hi All,

I am implementing the Google map component in aem 6.3 ,The plain HTML code is working as expected, when I added the HTML in sightly and js in clientlibs the <sciprt> tag throws an error in js console, . Uncaught type error <   in js .

      Is their any other way to implement the Google map component in Sightly , any docs or links would be helpful

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can use any JS/JQuery/Bootstrap lib in a HTL component. BTW - its not called Sightly. This is very straightforward. See this example -- Adobe Experience Manager Help | Creating an Adobe Experience Manager HTML Template Language componen...

View solution in original post

8 Replies

Avatar

Community Advisor

Hi,

you don't need to wrap your Javascript code in <script> tag, if you using clientLibs.

Thanks

Arun Patidar



Arun Patidar

Avatar

Level 2

Hi Arun

I have to add the source url for Google map api

I.e  <script src=https://googlemapapi.com > to load the map which I was not able to add.

Avatar

Community Advisor

where are you adding this SCRIPT tag? in .html page or in clientlibs?



Arun Patidar

Avatar

Level 2

Is there any other way to implement the map component without using script tag in js and sightly

Avatar

Community Advisor

Without script tag , how would you add external Javascript.

though you can add external javascript from clientlibs using below:

$(document).ready(function(){
  $
('body').append($('<script src="/path/to/script/foo.min.js"></script>'));
});

OR

You can directly add <SCRIPT> tag in HTL

Screen Shot 2018-05-28 at 7.48.57 PM.png

Screen Shot 2018-05-28 at 7.49.50 PM.png

It is a simple javascript call, In your code there might be some syntax error.

Thanks

Arun



Arun Patidar

Avatar

Level 2

We will try thanks for your quick response.

Avatar

Correct answer by
Level 10

You can use any JS/JQuery/Bootstrap lib in a HTL component. BTW - its not called Sightly. This is very straightforward. See this example -- Adobe Experience Manager Help | Creating an Adobe Experience Manager HTML Template Language componen...

Avatar

Level 2

Thanks Scott ,It was helpful