Asset Publisher

An error occurred while processing the template.
The following has evaluated to null or missing:
==> page_link?split("http://")[1]  [in template "818159#818205#826854" at line 58, column 50]

----
Tip: It's the final [] step that caused this error, not those before it.
----
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: #assign page_link_no_http = page_link...  [in template "818159#818205#826854" at line 58, column 21]
----
1<#-- 
2Application display templates can be used to modify the look of a 
3specific application. 
4 
5Please use the left panel to quickly add commonly used variables. 
6Autocomplete is also available and can be invoked by typing "${". 
7--> 
8 
9<#-- Selectores XML Contenido Miembro Consejo Admin --> 
10<#assign xPathFotoSelector = saxReaderUtil.createXPath("dynamic-element[@name='foto']/dynamic-content[@language-id='" + locale + "']") /> 
11<#assign xPathNombreSelector = saxReaderUtil.createXPath("dynamic-element[@name='nombre']/dynamic-content[@language-id='" + locale + "']") /> 
12<#assign xPathCargoSelector = saxReaderUtil.createXPath("dynamic-element[@name='cargo']/dynamic-content[@language-id='" + locale + "']") /> 
13<#assign xPathIntroSelector = saxReaderUtil.createXPath("dynamic-element[@name='introduccion']/dynamic-content[@language-id='" + locale + "']") /> 
14<#assign xPathDescripcionSelector = saxReaderUtil.createXPath("dynamic-element[@name='descripcion']/dynamic-content[@language-id='" + locale + "']") /> 
15 
16 
17<#if entries?has_content> 
18    <div class="container cyii_consejoAdmin"> 
19        <div class="row"> 
20            <#list entries as curEntry> 
21                <#assign renderer = curEntry.getAssetRenderer() /> 
22                <#assign className = renderer.getClassName() /> 
23                <#if className == "com.liferay.journal.model.JournalArticle"> 
24                    <#assign journalArticle = renderer.getArticle() /> 
25                    <#assign document = saxReaderUtil.read(journalArticle.getContent()) /> 
26                    <#assign rootElement = document.getRootElement() /> 
27 
28                    <#if xPathFotoSelector.selectSingleNode(rootElement)??> 
29                        <#assign foto = xPathFotoSelector.selectSingleNode(rootElement).getStringValue() /> 
30                    <#else> 
31                        <#assign foto = "" /> 
32                    </#if> 
33                    <#if xPathNombreSelector.selectSingleNode(rootElement)??> 
34                        <#assign nombre = xPathNombreSelector.selectSingleNode(rootElement).getStringValue() /> 
35                    <#else> 
36                        <#assign nombre = "" /> 
37                    </#if> 
38                    <#if xPathCargoSelector.selectSingleNode(rootElement)??> 
39                        <#assign cargo = xPathCargoSelector.selectSingleNode(rootElement).getStringValue() /> 
40                    <#else> 
41                        <#assign cargo = "" /> 
42                    </#if> 
43                    <#if xPathIntroSelector.selectSingleNode(rootElement)??> 
44                        <#assign introduccion = xPathIntroSelector.selectSingleNode(rootElement).getStringValue() /> 
45                    <#else> 
46                        <#assign introduccion = "" /> 
47                    </#if> 
48                    <#if xPathDescripcionSelector.selectSingleNode(rootElement)??> 
49                        <#assign descripcion = xPathDescripcionSelector.selectSingleNode(rootElement).getStringValue() /> 
50                    <#else> 
51                        <#assign descripcion = "" /> 
52                    </#if> 
53                    <#assign assetRenderer = curEntry.getAssetRenderer() /> 
54                         
55                    <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) /> 
56                     
57                    <#assign page_link = viewURL?split("/-/")[0] /> 
58                    <#assign page_link_no_http = page_link?split("http://")[1] /> 
59                    <#assign inte = page_link_no_http?index_of("/") /> 
60                    <#assign page_link_relative = page_link_no_http?substring(inte, page_link_no_http?length) /> 
61                    <#assign friendly_page_link = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
62 
63 
64                     
65 
66                    <div class="col-xs-12 col-sm-4 cyii_consejoAdmin_item"> 
67                        <div class="cyii_consejoAdmin_itemFondo"> 
68                            <div class="row"> 
69                                <div class="col-xs-6 col-sm-12 cyii_consejoAdmin_item_img"> 
70                                    <a href="${friendly_page_link + '?inheritRedirect=true&redirect=' + page_link_relative}" class="cyii_consejoAdmin_item_img_link"> 
71                                        <img src=${foto} alt="${nombre}"/> 
72                                        <span class="cyii_consejoAdmin_item_img_link_texto"> 
73                                            Más Información 
74                                        </span> 
75                                    </a> 
76                                </div> 
77                                <div class="col-xs-6 col-sm-12 cyii_consejoAdmin_item_texto"> 
78                                    <div class="cyii_consejoAdmin_item_texto_nombre"> 
79                                        ${nombre} 
80                                    </div> 
81                                    <div class="cyii_consejoAdmin_item_texto_cargo"> 
82                                        ${cargo} 
83                                    </div> 
84                                    <div class="cyii_consejoAdmin_item_texto_intro hidden-xs"> 
85                                        ${introduccion} 
86                                    </div> 
87                                </div> 
88                            </div> 
89                            <#assign id = "item" + curEntry_index/> 
90                            <div class="cyii_consejoAdmin_item_collapse hidden-sm hidden-md hidden-lg"> 
91                                <div class="cyii_consejoAdmin_item_collapse_boton"> 
92                                    <a href="#${id}" data-toggle="collapse"> 
93                                        <i class="fa fa-plus-circle"></i> 
94                                        <i class="fa fa-minus-circle"></i> 
95                                    </a> 
96 
97                                </div> 
98                                <div class="row"> 
99                                    <div class="col-xs-12"> 
100                                        <div id="${id}" class="collapse cyii_consejoAdmin_item_collapse_texto"> 
101                                            <div class="cyii_consejoAdmin_item_collapse_intro"> 
102                                                ${introduccion} 
103                                            </div> 
104                                            <div class="cyii_consejoAdmin_item_collapse_desc hidden-sm hidden-md hidden-lg"> 
105                                                ${descripcion} 
106                                            </div> 
107                                        </div> 
108                                    </div> 
109                                </div> 
110                            </div> 
111                        </div> 
112                    </div> 
113                </#if> 
114                <#if (curEntry_index != 0 && curEntry_index%3 == 2 && curEntry_index != (curEntry?size - 1))> 
115                    </div> 
116                    <div class="row">   
117                </#if> 
118            </#list> 
119        </div> 
120    </div> 
121</#if> 
122<script type="text/javascript"> 
123     
124    var A = AUI(); 
125    var intemsInside = A.all('.cyii_consejoAdmin_itemFondo'); 
126     
127    intemsInside.setStyle("height", "auto"); 
128     
129    if(Liferay.Util.getWindowWidth() >767){ 
130        heightItems(); 
131    }; 
132     
133    window.onresize = function(event) { 
134        intemsInside.setStyle("height", "auto"); 
135         
136        if(Liferay.Util.getWindowWidth() >767){ 
137            heightItems(); 
138        }; 
139         
140
141     
142    function heightItems(){ 
143         
144        var maxHeight = 0; 
145        var items = AUI().all('.cyii_consejoAdmin_item'); 
146        items.each(function(item){ 
147             
148            if(item.get('offsetHeight') > maxHeight){ 
149                maxHeight = item.get('offsetHeight'); 
150
151        }); 
152        intemsInside.setStyle("height", maxHeight); 
153    }; 
154</script>