Olá, como posso te ajudar?
Imprensa
583 Results for
An error occurred while processing the template.
The following has evaluated to null or missing:
==> entry.getDocument [in template "22106540883819#20119#2096309" at line 67, column 10]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
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 entry.getDocument()?? [in template "22106540883819#20119#2096309" at line 67, column 5]
----
1<style>
2 #meu-widget-gol {
3 max-width: 1148px !important;
4 margin: 0 auto !important;
5 display: block !important;
6 }
7
8 #meu-widget-gol .gol-views-row {
9 padding: 2.5rem 0 !important;
10 border-bottom: 1px solid #EAEAEA !important;
11 display: flex !important;
12 flex-direction: column !important;
13 font-family: 'GOLSansText', sans-serif !important;
14 }
15
16 /* DATA */
17 #meu-widget-gol .gol-date-category {
18 color: rgb(33, 37, 41) !important;
19 font-size: 12px !important;
20 font-weight: 700 !important;
21 margin-bottom: 5px !important;
22 display: block !important;
23 }
24
25 /* TÍTULO */
26 #meu-widget-gol .gol-title {
27 margin: 5px 0 !important;
28 display: block !important;
29 }
30
31 #meu-widget-gol .gol-title a {
32 color: rgb(43, 43, 43) !important;
33 font-size: 16px !important;
34 text-decoration: underline !important;
35 font-weight: 700 !important;
36 }
37
38 #meu-widget-gol .gol-title a:hover {
39 color: inherit !important;
40 text-decoration: underline !important;
41 }
42</style>
43
44<#if entries?has_content>
45 <#-- ENVELOPAMOS TUDO COM UM ID ÚNICO PARA PROTEGER O CSS -->
46 <div id="meu-widget-gol" class="gol-view-content">
47 <#list entries as entry>
48
49 <#-- ========================================================= -->
50<#-- FORÇANDO URL AMIGÁVEL DA DISPLAY PAGE -->
51<#-- ========================================================= -->
52
53<#assign url = "#" />
54
55<#attempt>
56 <#-- Buscamos o ID do Asset diretamente do objeto de busca -->
57 <#assign assetEntryId = getterUtil.getLong(entry.getAssetEntryId()) />
58
59 <#-- Acessamos o serviço de Asset -->
60 <#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
61 <#assign assetEntry = assetEntryLocalService.getAssetEntry(assetEntryId) />
62
63 <#-- PEGANDO A URL DA DISPLAY PAGE (O /W/...) -->
64 <#assign url = assetEntry.getLayoutURL(themeDisplay) />
65<#recover>
66 <#-- Se o de cima falhar, vamos tentar pegar a URL amigável manual do documento -->
67 <#if entry.getDocument()??>
68 <#assign doc = entry.getDocument() />
69 <#-- Tenta montar a URL baseada no slug que você editou manualmente -->
70 <#assign url = "/w/" + (doc.get("urlTitle_pt_BR"))!"" />
71 <#else>
72 <#assign url = entry.getViewURL() />
73 </#if>
74</#attempt>
75
76<#-- DEBUG: Remova isso depois, serve para você ver se a URL gerada está certa -->
77<#-- URL GERADA: ${url} -->
78<#-- ========================================================= -->
79
80 <#-- Título -->
81 <#assign titulo = "Notícia" />
82 <#if entry.getHighlightedTitle?? && entry.getHighlightedTitle()?has_content>
83 <#assign titulo = entry.getHighlightedTitle() />
84 <#elseif entry.getTitle?? && entry.getTitle()?has_content>
85 <#assign titulo = entry.getTitle() />
86 </#if>
87
88 <#-- Data -->
89 <#assign dataTexto = "--/--/--" />
90 <#attempt>
91 <#if entry.getDate?? && entry.getDate("createDate")?? && entry.getDate("createDate")?is_date>
92 <#assign dataTexto = entry.getDate("createDate")?string("dd/MM/yy") />
93 </#if>
94 <#recover>
95 </#attempt>
96
97 <#if dataTexto == "--/--/--">
98 <#if entry.getCreationDateString?? && entry.getCreationDateString()?has_content>
99 <#assign rawDate = entry.getCreationDateString() />
100 <#if rawDate?length gte 10>
101 <#assign dataTexto = rawDate?substring(0, 10) />
102 <#else>
103 <#assign dataTexto = rawDate />
104 </#if>
105 </#if>
106 </#if>
107
108 <#-- Descrição / Texto Longo -->
109 <#assign resumo = "" />
110 <#if entry.getDocument?? && entry.getDocument()??>
111 <#assign doc = entry.getDocument() />
112 <#assign resumo = (doc.get("content_pt_BR"))!"" />
113 </#if>
114 <#if resumo == "">
115 <#if entry.getContent?? && entry.getContent()?has_content>
116 <#assign resumo = entry.getContent() />
117 <#elseif entry.getSummary?? && entry.getSummary()?has_content>
118 <#assign resumo = entry.getSummary() />
119 </#if>
120 </#if>
121 <#if resumo == "">
122 <#if entry.getHighlightedContent?? && entry.getHighlightedContent()?has_content>
123 <#assign resumo = entry.getHighlightedContent() />
124 </#if>
125 </#if>
126
127 <div class="gol-views-row">
128
129 <#-- DATA -->
130 <span class="gol-date-category">
131 ${dataTexto}
132 </span>
133
134 <#-- TÍTULO -->
135 <h3 class="gol-title">
136 <a href="${url}">${titulo}</a>
137 </h3>
138
139 <#-- DESCRIÇÃO E LINK JUNTOS -->
140 <div style="margin-top: 8px !important; line-height: 1.5 !important; display: block !important; height: auto !important; overflow: visible !important;">
141
142 <#-- TEXTO DA DESCRIÇÃO -->
143 <span style="color: rgb(118, 118, 118) !important; font-size: 14px !important; display: inline !important; font-family: 'GOLSansText', sans-serif !important;">
144 <#if resumo?has_content>
145 ${resumo?replace("<[^>]*>", " ", "r")?replace(" ", " ", "r")?trim?truncate(400, "...")}
146 </#if>
147 </span>
148
149 <#-- LINK COLADO NO TEXTO -->
150 <a href="${url}" style="color: rgb(0, 120, 149) !important; font-size: 14px !important; text-decoration: underline !important; font-weight: 700 !important; display: inline !important; margin-left: 5px !important; font-family: 'GOLSansText', sans-serif !important; white-space: nowrap !important;">Continuar lendo</a>
151
152 </div>
153
154 </div>
155 </#list>
156 </div>
157<#else>
158 <div class="alert alert-info">Nenhum resultado encontrado.</div>
159</#if>

