Teste colapsável

COMPARTILHAR

Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing:
==> .vars['reserved-namespace']  [in template "30648863014451#20119#36564" at line 11, column 78]

----
Tip: It's the final [] step 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: ${.vars["reserved-namespace"].data}  [in template "30648863014451#20119#36564" at line 11, column 76]
----
1<#assign assetEntryLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") /> 
2<#assign jsonFactoryUtil=staticUtil["com.liferay.portal.kernel.json.JSONFactoryUtil"] /> 
3<#assign getterUtil=staticUtil["com.liferay.portal.kernel.util.GetterUtil"] /> 
4<#assign articleId=.vars['reserved-article-id'].data /> 
5<#assign date = dateUtil.parseDate("EEE, d MMM yyyy HH:mm:ss Z", .vars['reserved-article-modified-date'].data, locale)?string["dd/MM/yyyy HH'h'mm"] /> 
6 
7<#if collapse.collapse_title.getData()?has_content> 
8  <div aria-orientation="vertical" class="collapse-gdf panel-group" role="tablist"> 
9    <div role="tablist"> 
10      <#list collapse.getChildren() as cur_collapse> 
11        <button aria-controls="collapse-${articleId}-${cur_collapse?index}-${.vars['reserved-namespace'].data}" aria-expanded="false" class="btn btn-unstyled panel-header panel-header-link collapse-icon collapse-icon-middle collapsed mt-3 collapse-${cur_collapse.collapse_collor.getData()}" data-target="#collapse-${articleId}-${cur_collapse?index}-${.vars['reserved-namespace'].data}" data-toggle="collapse" role="tab"> 
12          <i class="las la-exchange-alt"></i> 
13          <span class="panel-title"> 
14            ${cur_collapse.collapse_title.getData()} 
15          </span> 
16        </button> 
17        <div class="panel-collapse collapse" id="collapse-${articleId}-${cur_collapse?index}-${.vars['reserved-namespace'].data}" role="tabpanel"> 
18          <div class="panel-body"> 
19            ${cur_collapse.collapse_content.getData()} 
20 
21            <#if cur_collapse.getChildren()?has_content> 
22              <#list cur_collapse.getChildren() as cur_collapse_groupCollapse> 
23                <#assign webContentData=jsonFactoryUtil.createJSONObject(cur_collapse_groupCollapse.getData()) /> 
24 
25                <#if webContentData?? && webContentData.title??> 
26                  <#assign assetEntry=assetEntryLocalService.getEntry(webContentData.className, getterUtil.getLong(webContentData.classPK)) /> 
27                  <#assign assetRenderer=assetEntry.getAssetRenderer() /> 
28                  <#assign journalArticle=assetRenderer.getAssetObject() /> 
29 
30                  <div class="p-2"> 
31                    <@liferay_journal["journal-article"] 
32                      articleId=journalArticle.getArticleId() 
33                      ddmTemplateKey=journalArticle.getDDMTemplateKey() 
34                      groupId=journalArticle.getGroupId() 
35                      wrapperCssClass="h-100" /> 
36                  </div> 
37                </#if> 
38              </#list> 
39            </#if> 
40          </div> 
41        </div> 
42      </#list> 
43    </div> 
44  </div> 
45</#if> 
46 
47<script> 
48  var date = new Date('${date}'); 
49 
50  if (!Liferay["lastModifiedDate"] || Liferay.lastModifiedDate < date) { 
51    Liferay.lastModifiedDate = date; 
52
53</script> 
54 
55<style> 
56.button-azul { 
57  padding: 10px; 
58  border-radius: 8px; 
59  background: #4079BC; 
60  color: white; 
61  margin: 15px; 
62  outline: none; 
63  border: none; 
64
65</style> 

Menu Exibir

COMPARTILHAR

Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing:
==> portletPreferences.getValue  [in template "30648863014451#20119#3027012" at line 16, column 37]

----
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: parentPageId = getterUtil.getLong(por...  [in template "30648863014451#20119#3027012" at line 16, column 3]
----
1<#--  
2  Template para Menu Exibir (Navigation Menu) 
3  Exibe apenas os filhos diretos de uma página específica selecionada manualmente 
4--> 
5 
6<#--  
7  Para usar este template: 
8  1. Crie um modelo em Site Administration > Design > Page Templates > Navigation Menu 
9  2. Copie e cole este código 
10  3. Nas configurações do portlet Navigation Menu, selecione este template 
11  4. Configure a preferência "parentLayoutId" com o ID da página pai desejada 
12--> 
13 
14<#-- Configurações --> 
15<#assign  
16  parentPageId = getterUtil.getLong(portletPreferences.getValue("parentLayoutId", "0")) 
17  cssClass = "children-only-menu" 
18/> 
19 
20<#-- Se não houver ID configurado, mostre uma mensagem --> 
21<#if parentPageId == 0> 
22  <#if themeDisplay.isSignedIn()> 
23    <div class="alert alert-info"> 
24      <p>Para configurar este menu:</p> 
25      <ol> 
26        <li>Clique no ícone de configuração (⚙️) deste portlet</li> 
27        <li>Vá para a aba "Configuração da Portlet" ou "Preferências"</li> 
28        <li>Adicione uma preferência com nome "parentLayoutId" e valor igual ao ID da página pai</li> 
29      </ol> 
30    </div> 
31  </#if> 
32<#else> 
33  <#-- Obter serviço de Layout --> 
34  <#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") /> 
35   
36  <#-- Buscar filhos diretos da página especificada --> 
37  <#assign childLayouts = layoutLocalService.getLayouts(themeDisplay.getScopeGroupId(), false, parentPageId) /> 
38   
39  <#if !childLayouts?has_content> 
40    <#if themeDisplay.isSignedIn()> 
41      <div class="alert alert-info"> 
42        <@liferay.language key="there-are-no-menu-items-to-display" /> 
43      </div> 
44    </#if> 
45  <#else> 
46    <div aria-label="<@liferay.language key="site-pages" />" class="${cssClass}"> 
47      <ul class="nav-menu"> 
48        <#list childLayouts as layout> 
49          <#assign isSelected = (themeDisplay.getLayout().getLayoutId() == layout.getLayoutId()) /> 
50           
51          <li class="nav-item ${isSelected?string('active', '')}"> 
52            <a href="${layout.getFriendlyURL()}" class="nav-link"> 
53              ${layout.getName(locale)} 
54            </a> 
55          </li> 
56        </#list> 
57      </ul> 
58    </div> 
59     
60    <#-- CSS Básico --> 
61    <style> 
62    .${cssClass} { 
63      margin: 1rem 0; 
64
65    .${cssClass} .nav-menu { 
66      list-style: none; 
67      padding-left: 0; 
68      margin: 0; 
69
70    .${cssClass} .nav-item { 
71      margin-bottom: 0.5rem; 
72
73    .${cssClass} .active > a { 
74      font-weight: bold; 
75      color: #0b5fff; 
76
77    </style> 
78  </#if> 
79</#if>