Thông tin chung
Có lỗi xảy ra trong quá trình xử lý biểu mẫu.
The following has evaluated to null or missing: ==> httpRequest.getPathInfo() [in template "20115#20151#49509" at line 133, column 31] ---- 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: listPartURL = httpRequest.getPathInfo... [in template "20115#20151#49509" at line 133, column 17] - Reached through: #assign-container [in template "20115#20151#49509" at line 132, column 1] ----
1<style scope>
2 .taglib-categorization-filter{
3 display:none
4 }
5 .article-title{
6 color: #0b5090;
7 text-decoration: none !important;
8 font-weight: bold;
9 padding: 0;
10 font-weight: bold;
11 margin-bottom: 5px
12 }
13 .article-img{
14 padding: 0;
15 }
16 .article-description{
17 padding-left: 10px;
18 text-align: justify;
19 }
20 .article-container{
21 padding: 0;
22 margin-bottom: 15px;
23 }
24 .article-title a{
25 color: #0b5090;
26 }
27 .list-container{
28 font-size: 14px;
29 }
30 .publish-date{
31 font-weight: bold;
32 color: grey;
33 }
34 .cms-title-category a{
35 color: #d70000;
36 font-weight: bold;
37 }
38 .title-category-container{
39 padding: 12px 0px 10px 12px;
40 border-bottom: 1px dotted #CBCBCB;
41 margin-bottom: 10px;
42 background: linear-gradient(#e9e9e9, #fbfbfb);
43 }
44 .search-date{
45 padding: 0;
46 float: left;
47 margin: 0 0 8px -24px;
48 display: flex;
49 }
50 .search-lable{
51 text-align: right;
52 padding: 8px;
53 font-weight: bold;
54 }
55 .search-input{
56 padding: 4px 1px 5px 5px;
57 }
58 #dateSearch {
59 height: 24px;
60 border: 1px solid #C8C9CA;
61 border-radius: 4px;
62 background: #fff;
63 width: 133px;
64 }
65 .btn-primary {
66 background-color: #337ab7;
67 height: 24px;
68 position: relative;
69 top: 4px;
70 width: 56px;
71 left: 43px;
72 border: 1px solid;
73 border-color: #C8C9CA #9E9E9E #9E9E9E #C8C9CA;
74 background: linear-gradient(#ffffff, #f2f2f2, #dedede, #d9d9d9);
75 Font-size: 12px;
76 font-weight: bold;
77 color: #2c6c97;
78 padding: 3px;
79 }
80 .taglib-page-iterator {
81 padding: 0 15px;
82 }
83 .lfr-icon-menu-text, .search-results, .lfr-pagination-buttons{
84 font-size: 12px;
85 }
86
87
88 @media only screen and (max-width: 767px){
89 .list-container {
90 padding: 6px;
91 }
92 .article-container {
93 margin-top: 0;
94 }
95 .search-button{
96 padding: 0;
97 }
98 .search-button .btn-primary{
99 left: 0;
100 }
101 .search-lable {
102 text-align: left;
103 padding: 8px 0 0 6px;
104 }
105 .search-date{
106 margin: 0;
107 }
108 .taglib-page-iterator{
109 padding: 0 6px;
110 }
111 .taglib-page-iterator .lfr-pagination-buttons{
112 display: flex;
113 }
114 .taglib-page-iterator .lfr-pagination-buttons>li>a{
115 width: 99%;
116 border-radius: 4px;
117 }
118 .taglib-page-iterator .lfr-pagination-config .current-page-menu .btn{
119 margin: 0 0 5px 0;
120 }
121 .search-results{
122 display: unset !important;
123 line-height: 35px !important;
124 color: #9e9e9e;
125 }
126 }
127
128
129</style>
130<#assign httpRequest = portalUtil.getOriginalServletRequest(portalUtil.getHttpServletRequest(renderRequest))>
131<#assign AssetCategoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryService")>
132<#assign dateSearch = getterUtil.getString(httpRequest.getParameter("date"))
133 listPartURL = httpRequest.getPathInfo()?split("-/categories/")
134 idCategory = ""
135 nameCategory = "Tin tức"
136>
137<#if (listPartURL?size >1)>
138<#assign
139 idCategory = listPartURL[1]
140 idCategory = idCategory?split("/")[0]
141 category = AssetCategoryService.getCategory(idCategory?number)
142 nameCategory = category.getName()
143 >
144<#else>
145 <#assign idCategory = getterUtil.getString(httpRequest.getParameter("p_r_p_categoryId"))>
146 <#if (idCategory?length >0)>
147 <#assign
148 category = AssetCategoryService.getCategory(idCategory?number)
149 nameCategory = category.getName()
150 >
151 </#if>
152</#if>
153
154<h2 class="portlet-title-text">
155<img class="portlet-title-icon" alt="title"
156src="/o/hcm-default-theme/images/imageVanBan/iconTitle.jpg">
157<span>${nameCategory}</span>
158</h2>
159
160<div class="row row-swt-responsive">
161 <div class="col-md-12 list-container">
162 <#if entries?has_content>
163 <#if validator.isNull(dateSearch)>
164 <#assign listToShow = entries >
165 <#else>
166 <#assign listToShow = [] >
167 <#list entries?chunk(1) as i>
168 <#assign dateSearch_DateObj = dateUtil.parseDate("yyyy-MM-dd", dateSearch, locale)
169 curEntryDate = i?first.getPublishDate()
170
171 >
172 <#if dateSearch_DateObj?date?string.short?contains(curEntryDate?date?string.short) >
173 <#assign listToShow = listToShow + i>
174 </#if>
175 </#list>
176 </#if>
177 <#list listToShow as curEntry>
178 <#assign
179 curEntry = curEntry
180
181 renderer = curEntry.getAssetRenderer()
182 article = renderer.getArticle() >
183
184 <#assign firstImgUrl = "" />
185
186 <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
187 <#assign journalArticle = journalArticleLocalService.fetchLatestArticle(curEntry.getClassPK()) />
188
189 <#if validator.isNotNull(journalArticle)>
190 <#assign content = journalArticle.getContent() />
191 <#if content?contains("<img")>
192 <#assign firstIndexImg = content?index_of("<img") />
193 <#assign newContent = content?substring(firstIndexImg)/>
194 <#assign lastIndexImg = newContent?index_of("/>") />
195
196 <#if (lastIndexImg >= 0) >
197 <#assign newContent = newContent?substring(0, lastIndexImg)/>
198 </#if>
199
200 <#assign strLenght= "src=\"" />
201 <#assign indexSrc = newContent?index_of(strLenght) + strLenght?length />
202 <#assign firstImgUrl = newContent?substring(indexSrc) />
203 <#assign lastIndexSrc = firstImgUrl?index_of("\"") />
204 <#assign firstImgUrl = firstImgUrl?substring(0,lastIndexSrc) />
205 </#if>
206 </#if>
207
208
209 <#if article.getSmallImage()>
210 <#assign imgThumbnailURL = renderer.getThumbnailPath(renderRequest)>
211 <#elseif (firstImgUrl?length > 0)>
212 <#assign imgThumbnailURL = firstImgUrl>
213 <#else>
214 <#assign imgThumbnailURL = "/o/hcm-default-theme/images/cms/no-image.jpg" >
215 </#if>
216 <#assign publishDate = curEntry.getPublishDate()
217 publishDate_txt = "(" + publishDate?date?string["dd/MM/yyyy"] + ")"
218 urlArticle = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, renderer, curEntry, !stringUtil.equals(assetLinkBehavior, "showFullContent"))
219 >
220
221 <div class="col-md-12 article-container">
222 <div class="col-md-12 article-title">
223 <a href="${urlArticle}">
224 ${article.getTitle()?replace('<[^>]+>','','r')} <span class="publish-date">${publishDate_txt}<span>
225 </a>
226 </div>
227 <div class="col-md-12 col-swt">
228 <div class="col-md-3 article-img">
229 <a href="${urlArticle}">
230 <img src="${imgThumbnailURL}" width=100%/>
231 </a>
232 </div>
233 <div class="col-md-9 article-description">
234 ${article.getDescription()}
235 </div>
236 </div>
237 </div>
238 </#list>
239 </#if>
240 </div>
241</div>
242<div class="row search-date">
243 <div class="col-md-5 search-lable">
244 Xem theo ngày:
245 </div>
246 <div class="col-md-3 search-input">
247 <input type="date" id="dateSearch" value="${dateSearch}"/>
248 </div>
249 <div class="col-md-4 search-button">
250 <div class="btn btn-primary" onClick="searchDate()">
251 Tìm
252 </div>
253 </div>
254</div>
255<script type="text/javascript">
256 function searchDate(){
257 var date = $("#dateSearch").val();
258 var url = "?date=" + date;
259 window.location.href = url;
260 }
261</script>