The following has evaluated to null or missing: ==> value [in template "50641277188737#33046#36177" at line 75, column 70] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #if key == "dataLayer" && value != "" [in template "50641277188737#33046#36177" at line 75, column 43] ----
1<script>
2 window.dataLayer = window.dataLayer || [];
3</script>
4
5
6<#if entries?has_content>
7 <div class="d-c-preheader-btn-group_container">
8 <ul id="d-js-preheader-btn-group" class="d-js-dropdowns container-carrusel slider d-c-preheader-btn-group owl-carousel owl-theme">
9
10 <#assign count = 0 />
11 <#assign count2 = 0 />
12 <#assign isFirst = true />
13 <#assign containerBoxCount = 0 />
14 <#assign nonChildCount = 0 />
15
16 <#list entries as navigationEntry>
17 <#if navigationEntry?index == 5>
18 <#break />
19 </#if>
20
21 <#if navigationEntry.hasChildren()>
22 <#if navigationEntry.getExpandoAttributes()??>
23 <#list navigationEntry.getExpandoAttributes() as key, value>
24 <#if key == "datalayer" && value != "">
25 <script>
26 $(document).ready(function(){
27 $("#preheader${navigationEntry.getName()?replace(" ", "")}").on('click', function(){
28 window.dataLayer.push(
29 ${value}
30 );
31 console.log(window.dataLayer);
32 })
33 });
34 </script>
35 </#if>
36 </#list>
37 </#if>
38 <li class="d-c-preheader-item item-carrusel" data-dropdown="true">
39 <div class="d-o-dropdown d-t-dropdown item">
40 <a itemprop="url" class="d-t-dropdown__btn d-t-dropdown__btn-preheader d-js-dropdown" href="#" role="button" aria-expanded="false" id="preheader${navigationEntry.getName()?replace(" ", "")}">
41 <span class="d-c-preheader-text">
42 ${stringUtil.shorten(htmlUtil.stripHtml(navigationEntry.getUnescapedName()), 25, "")}
43 </span>
44 <span class="d-t-dropdown__btn-icon" aria-hidden="true">
45 <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="24" viewBox="0 0 16 24" fill="none">
46 <path d="M7.29377 15.7103C7.6844 16.1009 8.31877 16.1009 8.7094 15.7103L14.7094 9.7103C15.1 9.31968 15.1 8.6853 14.7094 8.29468C14.3188 7.90405 13.6844 7.90405 13.2938 8.29468L8.00002 13.5884L2.70627 8.2978C2.31565 7.90718 1.68127 7.90718 1.29065 8.2978C0.900024 8.68843 0.900024 9.3228 1.29065 9.71343L7.29065 15.7134L7.29377 15.7103Z"></path>
47 </svg>
48 </span>
49 </a>
50
51 <div class="d-t-dropdown__content d-js-dropdown__content" aria-labelledby="dropdown-preheader-${count}" id="dropdown-preheader-${count}-drop-content">
52 <#assign count++ />
53 <div class="d-t-dropdown__content-container container" style="display: flex;">
54 <#assign containerBoxCount = 0 />
55 <#list navigationEntry.getChildren() as childEntry>
56 <#if containerBoxCount == 3>
57 <#break />
58 </#if>
59
60
61
62 <div class="d-t-dropdown__container-box">
63 <span class="d-t-dropdown__container-title">
64 ${stringUtil.shorten(htmlUtil.stripHtml(childEntry.getUnescapedName()), 40, "")}
65 </span>
66 <div class="d-t-dropdown__item-content">
67 <#assign itemCount = 0 />
68 <#list childEntry.getChildren() as subChildEntry>
69 <#if itemCount == 6>
70 <#break />
71 </#if>
72
73 <#if subChildEntry.getExpandoAttributes()??>
74 <#list subChildEntry.getExpandoAttributes() as key, value>
75 <#if key == "dataLayer" && value != "">
76 <script>
77 $(document).ready(function(){
78 $("#preheader${subChildEntry.getName()?replace(" ", "")}").on('click', function(event){
79 event.preventDefault();
80 var URL = $(this).attr('href');
81 var target = $(this).attr('target');
82 window.dataLayer.push(
83 ${value}
84 );
85 console.log(window.dataLayer);
86
87 setTimeout(function(){
88 if (target === '_blank') {
89 window.open(URL, '_blank');
90 } else {
91 window.location.href = URL;
92 }
93 }, 0);
94 });
95 });
96 </script>
97 </#if>
98 </#list>
99 </#if>
100
101 <a class="d-t-dropdown__item" id= "preheader${subChildEntry.getName()?replace(" ", "")}" href="${subChildEntry.getURL()}" ${subChildEntry.getTarget()} title="ir a ${stringUtil.shorten(htmlUtil.stripHtml(subChildEntry.getUnescapedName()))}">
102 ${stringUtil.shorten(htmlUtil.stripHtml(subChildEntry.getUnescapedName()), 35, "")}
103 </a>
104 <#assign itemCount++ />
105 </#list>
106 </div>
107 </div>
108 <#assign containerBoxCount++ />
109 </#list>
110
111 </div>
112 </div>
113 </div>
114 <div class="d-c-preheader-line"></div>
115 </li>
116 <#else>
117 <#assign isActive = false>
118 <#if navigationEntry.getExpandoAttributes()??>
119 <#list navigationEntry.getExpandoAttributes() as key, value>
120 <#if getterUtil.getBoolean(value) == true && key == "pagina_actual">
121 <#assign isActive = true />
122 </#if>
123
124 <#if key == "dataLayer" && value != "">
125 <script>
126 $(document).ready(function(){
127 $("#preheader${navigationEntry.getName()?replace(" ", "")}").on('click', function(event){
128 event.preventDefault();
129 var URL = $(this).attr('href');
130 var target = $(this).attr('target');
131 window.dataLayer.push(
132 ${value}
133 );
134
135 setTimeout(function(){
136 if (target === '_blank') {
137 window.open(URL, '_blank');
138 } else {
139 window.location.href = URL;
140 }
141 }, 0);
142 });
143 });
144 </script>
145 </#if>
146 </#list>
147 </#if>
148
149 <li class="d-c-preheader-item item-carrusel" data-dropdown="false">
150 <#if nonChildCount < 2>
151 <#assign charLimit = 12 />
152 <#else>
153 <#assign charLimit = 25 />
154 </#if>
155 <a itemprop="url" class="item <#if isActive> d-t-btn-preheader--active</#if>" id="preheader${navigationEntry.getName()?replace(" ", "")}" href="${navigationEntry.getURL()}" ${navigationEntry.getTarget()} title="ir a ${stringUtil.shorten(htmlUtil.stripHtml(navigationEntry.getUnescapedName()))}">
156 <span class="d-c-preheader-text">
157 ${stringUtil.shorten(htmlUtil.stripHtml(navigationEntry.getUnescapedName()), charLimit, "")}
158 </span>
159 </a>
160 <div class="d-c-preheader-line"></div>
161 </li>
162 <#assign nonChildCount++ />
163
164 </#if>
165 </#list>
166
167 </ul>
168 </div>
169</#if>
Le puede interesar