Belgium insights home

Breadcrumb

From the Brink's Vault

Providing you with insights around operational efficiencies, emerging trends and industry insights you can actually use.

Asset Publisher

An error occurred while processing the template.
The following has evaluated to null or missing:
==> templateKey  [in template "20101#20128#81003" at line 135, column 51]

----
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: @liferay_journal["journal-article"] a...  [in template "20101#20128#81003" at line 133, column 29]
----
1<#assign caseStudyStructureId = brinks_freemarker_util.getStructureIdsByStructureKey(["CASE_STUDY"])!"" /> 
2<#assign blogStructureId = brinks_freemarker_util.getStructureIdsByStructureKey(["BLOG_POST"])!"" /> 
3<#assign eventStructureId = brinks_freemarker_util.getStructureIdsByStructureKey(["EVENT"])!"" /> 
4<#assign insightTopics = brinks_freemarker_util.getInsightTopicsByGroupIdAndLocale(themeDisplay.getSiteGroupId())!"" /> 
5 
6<div class="component-blue brinks-filter-container insight-container"> 
7    <div class="page-width spacing-small"> 
8        <div class="card-filters"> 
9            <h2 class="text-center card-filters-title f-white"><@liferay.language key="our-insights" /></h2> 
10            <@portlet["renderURL"] var="searchURL"></@> 
11            <@liferay_aui["form"] action="${searchURL}" name="fm1" method="get"> 
12                <div class="row relative"> 
13                    <#if insightTopics?has_content> 
14                        <div class="col-12 col-md-4 col-lg-3"> 
15                            <div class="brinks-select"> 
16                                <@liferay_aui["select"] id="categoryId" name="categoryId" label=""> 
17                                    <@liferay_aui["option"] label="all-topics" value="0"></@> 
18                                    <#list insightTopics as topic> 
19                                        <@liferay_aui["option"] label="${topic.getTitle(locale)}" value="${topic.getCategoryId()}"></@><#--passing category id as value  --> 
20                                    </#list> 
21                                </@> 
22                            </div> 
23                        </div>                     
24                        <div class="col-12 col-md-4 col-lg-3"> 
25                            <div class="brinks-select"> 
26                                <@liferay_aui["select"] id="classTypeId" name="classTypeId" label=""> 
27                                    <@liferay_aui["option"] label="all-content-types" value="0"></@> 
28                                    <#if caseStudyStructureId?has_content> 
29                                        <@liferay_aui["option"] label="case-study" value="${caseStudyStructureId[0]}"></@><#--passing structure Id as value  --> 
30                                    </#if> 
31                                    <#if blogStructureId?has_content> 
32                                        <@liferay_aui["option"] label="blog-posts" value="${blogStructureId[0]}"></@> 
33                                    </#if> 
34                                    <#if eventStructureId?has_content> 
35                                        <@liferay_aui["option"] label="events" value="${eventStructureId[0]}"></@> 
36                                    </#if> 
37                                </@> 
38                            </div> 
39                        </div> 
40                        <div class="col-12 col-md-4 col-lg-3"> 
41                            <div class="brinks-select"> 
42                                <#assign endDate = 2019 /> 
43                                <@liferay_aui["select"] id="orderDate" name="orderDate" label=""> 
44                                    <@liferay_aui["option"] label="most-recent" value=""></@> 
45                                    <#list .now?string('yyyy')?number+1..endDate as i> 
46                                        <@liferay_aui["option"] value="${i}">${i}</@> 
47                                    </#list> 
48                                </@> 
49                            </div> 
50                        </div> 
51                        <div class="col-12 col-md-12 col-lg-3"> 
52                            <div class="brinks-input"> 
53                                <@liferay_aui["input"] type="text" name="keywords" label="" placeholder="keywords"></@>  
54                            </div> 
55                        </div> 
56                    <#else> 
57                        <div class="col-12 col-md-4"> 
58                            <div class="brinks-select"> 
59                                <@liferay_aui["select"] id="classTypeId" name="classTypeId" label=""> 
60                                    <@liferay_aui["option"] label="all-content-types" value="0"></@> 
61                                    <#if caseStudyStructureId?has_content> 
62                                        <@liferay_aui["option"] label="case-study" value="${caseStudyStructureId[0]}"></@><#--passing structure Id as value  --> 
63                                    </#if> 
64                                    <#if blogStructureId?has_content> 
65                                        <@liferay_aui["option"] label="blog-posts" value="${blogStructureId[0]}"></@> 
66                                    </#if> 
67                                    <#if eventStructureId?has_content> 
68                                        <@liferay_aui["option"] label="events" value="${eventStructureId[0]}"></@> 
69                                    </#if> 
70                                </@> 
71                            </div> 
72                        </div> 
73                        <div class="col-12 col-md-4"> 
74                            <div class="brinks-select"> 
75                                <#assign endDate = 2019 /> 
76                                <@liferay_aui["select"] id="orderDate" name="orderDate" label=""> 
77                                    <@liferay_aui["option"] label="most-recent" value=""></@> 
78                                    <#list .now?string('yyyy')?number+1..endDate as i> 
79                                        <@liferay_aui["option"] value="${i}">${i}</@> 
80                                    </#list> 
81                                </@> 
82                            </div> 
83                        </div> 
84                        <div class="col-12 col-md-4"> 
85                            <div class="brinks-input"> 
86                                <@liferay_aui["input"] type="text" name="keywords" label="" placeholder="keywords"></@>  
87                            </div> 
88                        </div> 
89                    </#if> 
90                    <@liferay_aui["input"] type="hidden" name="scrollIntoView" value="false"></@> 
91                    <@liferay_aui["input"] type="hidden" id="enableCustomDateRangeFilter" name="enableCustomDateRangeFilter" value=false></@> 
92                    <@liferay_aui["input"] type="hidden" name="customDateAttributeKeys"></@> 
93                    <@liferay_aui["input"] type="hidden" id="fromDate" name="fromDate"></@> 
94                    <@liferay_aui["input"] type="hidden" id="toDate" name="toDate"></@> 
95                    <@liferay_aui["input"] type="hidden" id="enableCustomAttributesFilter" name="enableCustomAttributesFilter" value=false></@> 
96                    <@liferay_aui["input"] type="hidden" id="customAttributeKeyValueMap" name="customAttributeKeyValueMap"></@> 
97                    <@liferay_aui["input"] type="hidden" id="customDateRangeJSON" name="customDateRangeJSON"></@> 
98                    <@liferay_aui["input"] type="hidden" id="additionalParams" name="additionalParams" value="scrollIntoView,orderDate,classTypeId"></@> 
99 
100                    <#assign queryString = httpUtil.getQueryString(searchURL)> 
101                    <#assign parameterMap = httpUtil.getParameterMap(queryString)> 
102                    <#list parameterMap?keys as key> 
103                        <input name="${key}" type="hidden" value="${parameterMap[key][0]}" /> 
104                    </#list> 
105                </div> 
106            </@> 
107        </div> 
108    </div> 
109</div> 
110 
111<#if entries?has_content> 
112    <div class="component-gray title-section nobutton" id="insight-list"> 
113        <div class="page-width spacing-small"> 
114            <div class="row equal-content-height"> 
115                <#list entries as curEntry> 
116                    <#if "com.liferay.journal.model.JournalArticle" == curEntry.getAssetRenderer().getClassName() > 
117 
118                        <#assign assetRenderer = curEntry.getAssetRenderer()> 
119                        <#assign article = assetRenderer.getArticle()> 
120                        <#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) /> 
121                        <div class="col-lg-4 col-md-6"> 
122                            <div class="custom-edit align-card"> 
123                                <@getEditIcon /> 
124                            </div> 
125 
126                            <#if curEntry.getAssetRenderer().getArticle().getDDMStructure().getName()?contains("Case Study")> 
127                            <#assign templateKey = (themeDisplay.getCompanyGroupId() == assetRenderer.getGroupId())?then('GLOBAL_CASE_STUDY_ABSTRACT', 'CASE_STUDY_ABSTRACT')/> 
128                            <#elseif curEntry.getAssetRenderer().getArticle().getDDMStructure().getName()?contains("Blog Post")> 
129                                <#assign templateKey = (themeDisplay.getCompanyGroupId() == assetRenderer.getGroupId())?then('GLOBAL_BLOG_POST_ABSTRACT', 'BLOG_POST_ABSTRACT')/> 
130                            <#elseif curEntry.getAssetRenderer().getArticle().getDDMStructure().getName()?contains("Event")> 
131                                <#assign templateKey = (themeDisplay.getCompanyGroupId() == assetRenderer.getGroupId())?then('GLOBAL_EVENT_ABSTRACT', 'WEBINAR_ABSTRACT')/> 
132                            </#if> 
133                            <@liferay_journal["journal-article"] 
134                                articleId="${curEntry.getAssetRenderer().getArticle().getArticleId()}"  
135                                ddmTemplateKey="${templateKey}" 
136                                groupId=curEntry.getAssetRenderer().getGroupId() /> 
137 
138                        </div> 
139                    </#if> 
140                </#list> 
141            </div> 
142        </div> 
143    </div> 
144<#else> 
145    <div class="alert alert-info"> 
146        <@liferay_ui["message"] key="there-are-no-results" /> 
147    </div> 
148</#if> 
149 
150<#macro getEditIcon> 
151    <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
152        <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("NORMAL"), themeDisplay.getURLCurrent())!"" /> 
153 
154        <#if validator.isNotNull(editPortletURL)> 
155            <#assign title = languageUtil.format(locale, "edit-x", entryTitle, false) /> 
156 
157            <@liferay_ui["icon"] 
158                cssClass="icon-monospaced visible-interaction" 
159                icon="pencil" 
160                markupView="lexicon" 
161                message=title 
162                url=editPortletURL.toString() 
163            /> 
164        </#if> 
165    </#if> 
166</#macro> 
167 
168<script> 
169    var prefix = "#" + "${portletDisplay.namespace}" 
170    var formId = prefix + "fm1"; 
171 
172    $(document).ready(function () { 
173 
174        /* Grab form field inputs */ 
175        var orderDate = $(prefix + "orderDate"); 
176 
177        /* Grab hidden form inputs */ 
178        var fromDate = $(prefix + "fromDate"); 
179        var toDate = $(prefix + "toDate"); 
180        var customDateRangeFilter = $(prefix + "enableCustomDateRangeFilter"); 
181        var customDateRangeJSON = $(prefix + "customDateRangeJSON"); 
182        var customAttributesFilter = $(prefix + "enableCustomAttributesFilter"); 
183        var customAttributeKeyValueMap = $(prefix + "customAttributeKeyValueMap"); 
184        var customDateAttributeKeys = $(prefix + "customDateAttributeKeys"); 
185        var insightSelects = $('.brinks-select'); 
186         
187        for (let i = 0; i < insightSelects.length; i++) { 
188            insightSelects[i].addEventListener('click', function(event) { 
189                $("form[name='${portletDisplay.namespace}fm1']").submit(); 
190            }); 
191
192        /* Handle onFormSubmition */ 
193        $(prefix + "fm1").submit(function () { 
194            $(fromDate).val(""); 
195            $(toDate).val(""); 
196            let dateRangeJson = {}; 
197 
198            if($(orderDate).val().length > 0){ 
199                var fromDateSelection = $(orderDate).val() + "-" + (01) + "-" + (01); 
200                var toDateSelection = $(orderDate).val() + "-" + (12) + "-" + (31); 
201                 
202                $(fromDate).val(fromDateSelection); 
203                $(toDate).val(toDateSelection); 
204                 
205                dateRangeJson["filterable_startDate"] = {}; 
206                dateRangeJson["filterable_startDate"]['fromDate'] = fromDateSelection; 
207                dateRangeJson["filterable_startDate"]['toDate'] = toDateSelection; 
208                 
209                dateRangeJson["filterable_blogDate"] = {}; 
210                dateRangeJson["filterable_blogDate"]['fromDate'] = fromDateSelection; 
211                dateRangeJson["filterable_blogDate"]['toDate'] = toDateSelection; 
212 
213                dateRangeJson["filterable_caseDate"] = {}; 
214                dateRangeJson["filterable_caseDate"]['fromDate'] = fromDateSelection; 
215                dateRangeJson["filterable_caseDate"]['toDate'] = toDateSelection; 
216
217 
218            /* Generate customDateRangeJSON String */ 
219            if(Object.keys(dateRangeJson).length > 0){ 
220                $(customDateRangeFilter).val(true); 
221                $(customDateRangeJSON).val(JSON.stringify(dateRangeJson)); 
222
223 
224            $(prefix + "scrollIntoView").val('true'); 
225        }); 
226 
227        /* Remove quotes on page load */ 
228        var $keywordsInput = $("input[name='${portletDisplay.namespace}keywords']"); 
229        if ($keywordsInput.val().length > 0) { 
230            if ($keywordsInput.val().indexOf("\"") == 0) { 
231                $keywordsInput.val($keywordsInput.val().slice(1)); 
232
233            if ($keywordsInput.val().lastIndexOf("\"") == ($keywordsInput.val().length - 1)) { 
234                $keywordsInput.val($keywordsInput.val().slice(0, $keywordsInput.val().length - 1)); 
235
236
237 
238        /* Add quotes on form submit */ 
239        $("form[name='${portletDisplay.namespace}fm1']").submit(function () { 
240            var $keywordsInput = $("input[name='${portletDisplay.namespace}keywords']"); 
241            if ($keywordsInput.val().length > 0) { 
242                if ($keywordsInput.val().indexOf("\"") == -1) { 
243                    $keywordsInput.val("\"" + $keywordsInput.val()); 
244
245                if ($keywordsInput.val().lastIndexOf("\"") == 0) { 
246                    $keywordsInput.val($keywordsInput.val() + "\""); 
247
248
249        }); 
250 
251    }); 
252</script>