활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
조회 수
답글
좋아요 수
<sly data-sly-include="yourscript.html" />
This is how you include scripts.
Hi
Adding to what Feike said,
Please have a look at this community article covering many example for HTL (formerly know as Sightly).
Link:-http://blogs.adobe.com/experiencedelivers/experience-management/htl-intro-part-1/
~kautuk
조회 수
답글
좋아요 수
조회 수
답글
좋아요 수
Feike Visser wrote...
<sly data-sly-include="yourscript.html" />
This is how you include scripts.
So can we include following script directly in "yourscript.html " directly and use as u specified above-
<script>
var digitalData = $('#digitalData').val();
var date = new Date();
var clientHourOfDay = date.getHours();
var pageVisitJson = JSON.parse('${datalayer.pageVisitAsString}');
var systemHourOfDay = pageVisitJson['hourOfDay'];
var diffHourOfDay = clientHourOfDay - systemHourOfDay;
var days = ['Sunday','Monday','Tu','W','Th','Fry','Satuay'];
var isWeekend = "false";
if (diffHourOfDay >= -2 && diffHourOfDay <= 2) {
digitalData.visit.hourOfDay = clientHourOfDay;
digitalData.visit.dayOfWeek = days[date.getDay()];
if(date.getDay()===6 || date.getDay()===0){isWeekend="true";}
digitalData.visit.isWeekend = isWeekend;
}
</script>
조회 수
답글
좋아요 수
Yes. Although you will probably need to include the "@context=" where appropriate since you are populating a JS string. You will need to chose the appropriate context scriptstring, unsafe, etc.. that matches what you populating.
조회 수
답글
좋아요 수
조회 수
Likes
답글