Resuelve tus dudas

Resuelve tus dudas

null Combo 15GB Pick UP
Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing:
==> link  [in template "33501#33537#PL_COMBO_LINEAL" at line 32, column 14]

----
Tip: If the failing expression is known to be 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 link?contains(cat1Url)  [in template "33501#33537#PL_COMBO_LINEAL" at line 32, column 9]
----
1<#-- 
2Last update: 01/08/2019 
3Changelog (Last 3): 
4	04/09/2019: Modificación  
5	01/08/2019: Lógica para setear los valores data-id y data-category para GTM. 
6--> 
7 
8<#-- Google Tag manager--> 
9	<#-- 
10		Categoría de Producto para el caso de Ecuador: 
11 
12		1. Línea nueva y combo 
13		2. Portabilidad y combo 
14		3. Comprar combo 
15		4. Comprar comodines 
16	--> 
17 
18	<#assign vPageLink = button.buttonPageLink.getFriendlyUrl()> 
19	<#assign vExtLink = button.buttonExtLink.getData()> 
20 
21	<#if vExtLink?has_content> 
22		<#assign link = vExtLink> 
23	<#elseif vPageLink?has_content> 
24		<#assign link = vPageLink> 
25	</#if> 
26 
27	<#assign cat1Url = '/pasarme-a-tuenti-con-linea-nueva'/> 
28	<#assign cat2Url = '/portarse-a-tuenti'/> 
29	<#assign cat3Url = '/only-combo-here'/> 
30	<#assign cat4Url = '/only-xtra-here'/> 
31 
32	<#if link?contains(cat1Url)> 
33		<#assign comboId = IDsAMDOCS.idChip.getData()/> 
34		<#assign comboCategory = 'Línea nueva y combo'/> 
35	<#elseif link?contains(cat2Url)> 
36		<#assign comboId = IDsAMDOCS.idChip.getData()/> 
37		<#assign comboCategory = 'Portabilidad y combo'/> 
38	<#elseif link?contains(cat3Url)> 
39		<#assign comboId = IDsAMDOCS.idSinChip.getData()/> 
40		<#assign comboCategory = 'Comprar combo'/> 
41	<#elseif link?contains(cat4Url)> 
42		<#assign comboId = ''/> 
43		<#assign comboCategory = 'Comprar comodines'/> 
44	<#else> 
45		<#assign comboId = 'No category match'/> 
46		<#assign comboCategory = link/> 
47	</#if> 
48 
49<#-- /Google Tag manager--> 
50 
51<div class="section-combos-list"> 
52	<div class="container container-section"> 
53		<div class="row-list-combos"> 
54			<div class="item-list-combo"> 
55				<div class="item-inline data-size"> 
56					<div class="content"> 
57						<div class="col-image"><img src="/documents/33537/82530/chip-carrusel.png/4a9d5125-5ff8-7a26-28fe-cf82d8f55752?t=1555342021772" alt="chip" title="chip"></div> 
58						<div class="col-text"> 
59							<span class="top">${upperText.getData()}</span> 
60							<h3 class="size">${size.getData()}</h3> 
61						</div> 
62					</div> 
63				</div> 
64				<div class="item-inline data-list"> 
65					<div class="content"> 
66						<@getFeatures /> 
67					</div> 
68				</div> 
69				<div class="item-inline data-price"> 
70					<div class="content"> 
71						<span class="price">${priceValue.getData()}</span> 
72						<p class="bottom-price">x mes</p> 
73					</div> 
74				</div> 
75				<div class="item-inline data-btn"> 
76					<div class="content"> 
77					 
78    					<#-- Button --> 
79            			<#if button.buttonExtLink.getData()?has_content> 
80            				<#assign link = button.buttonExtLink.getData()> 
81            			<#elseif button.buttonPageLink.getFriendlyUrl()?has_content> 
82            				<#assign link = button.buttonPageLink.getFriendlyUrl()> 
83            			</#if> 
84            			 
85            	<#-- Google Tag manager--> 
86                   <#if button.idGTM.getData()??> 
87                      <#assign GTM = button.idGTM.getData()> 
88                   </#if> 
89 
90						<a href="${link}?producto=${.vars['reserved-article-url-title'].data}" title="" class="btn btn-red ${GTM}">${button.getData()}</a> 
91					</div> 
92				</div> 
93				 
94				<div class="check-compare"> 
95		         <span class="text select-comp" onclick="comparar(this)">Comparar  
96		         <span class="btn-check checked-buy"></span></span> 
97				</div> 
98			</div> 
99		</div> 
100	</div> 
101</div> 
102 
103<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")/> 
104<#assign destinationLayout = layoutLocalService.getFriendlyURLLayout(groupId, false, "/comparadorCombos")/> 
105<#assign urlComparadorCombos = portalUtil.getLayoutFriendlyURL(layoutLocalService.getLayout(destinationLayout.getPlid()), themeDisplay,locale)/> 
106 
107 
108<script> 
109	var compararCombos=[]; 
110	 
111	function comparar(index){ 
112		var element= $(index); 
113		if(element.find('.select-comparar').length == 1){ 
114			element.children().removeClass("select-comparar icons-check-simple"); 
115			compararCombos=[]; 
116		}else{ 
117			element.children().addClass("select-comparar icons-check-simple"); 
118			var articleId=$(index).parents(".section-combos-list").prev(".articleId-combo").text(); 
119			compararCombos.push(articleId); 
120			if(compararCombos.length == 2){ 
121				var allCombos=[]; 
122				for(var i=0;i<$(".articleId-combo").length;i++){ 
123					allCombos.push($($(".articleId-combo").get(i)).text()); 
124
125				var groupId=$($(".groupId-combo").get(0)).text(); 
126				window.location.href="${urlComparadorCombos}?group="+groupId+"&combos="+allCombos.join()+"&comp="+compararCombos.join(); 
127
128
129
130</script> 
131 
132<!-- Track event for Google Tag Manager --> 
133<script> 
134$(".${GTM}").on('click', function(event){ 
135    event.stopPropagation(); 
136    event.stopImmediatePropagation(); 
137 
138    // Establece data-id y data-category para GTM 
139    $('.section-combos-list').attr('data-id', '${comboId}'); 
140	$('.section-combos-list').attr('data-category', '${comboCategory}'); 
141	 
142	dataLayer.push({ 
143		'event':'trackEvent', 
144		'eventCategory':'Categoria de producto - Combos',		 
145		'eventAction':'Opciones de producto Combos', 
146		'eventLabel':'${size.getData()}' 
147	}); 
148}); 
149</script> 
150<!-- End track event for Google Tag Manager --> 
151 
152<#macro getFeatures> 
153	<#if features.getSiblings()?has_content> 
154		<ul class="col-list"> 
155			<#assign flagFeature=0> 
156			<#list features.getSiblings() as cur_features> 
157				<li class="item"> 
158					<p class="text">${cur_features.getData()}</p> 
159				</li> 
160			</#list> 
161			<li class=""> 
162		<#if (iconosApps.getSiblings())?has_content> 
163			<#list iconosApps.getSiblings() as cur_icons> 
164				<a href="" title="" class="link-rrss"><img class="bottom-img" src="${cur_icons.getData()}" alt="${cur_icons.AltIconoApp.getData()}" title="${cur_icons.TituloIconoApp.getData()}"/></a> 
165			</#list> 
166		</#if> 
167			</li> 
168		</ul> 
169	</#if> 
170</#macro>