2017-03-04 6 views
2

테마를 만들고 Liferay Classic Theme에서 navigation.ftl을 복사했지만 내 테마에서 탐색 제목이 아래 스크린 샷과 같이 표시됩니다. 내가 관리자로 로그인 한 경우liferay 테마의 탐색 메뉴 제목을 삭제하는 방법은 무엇입니까?

enter image description here

, 나는 텍스트를 편집하고 빈 확인하고 저장 할 수 있어요 그리고 멀리 간다. 그러나 내가 페이지를 새로 고침 할 때, 그것은 내가 생각하는 버그가 다시 온다.

하지만 내 질문은 제목에서 어디서나 제목이 나타나지 않도록해야한다는 것입니다.

내 사용자 정의 테마

.portlet-static.portlet-static-end.portlet-barebone.portlet-navigation .portlet-content.portlet-content-editable .portlet-title-text { display:none !important; }

편집에 다음 CSS를 사용하여 (탐색 메뉴 포틀릿의) 제목을 숨길 수 있었다

<#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId",  "barebone") /> 

<div aria-expanded="false" class="collapse navbar-collapse" id="navigationCollapse"> 
<#if has_navigation && is_setup_complete> 
    <nav class="${nav_css_class} site-navigation" id="navigation" role="navigation"> 
     <div class="navbar-right"> 
      <@liferay.navigation_menu default_preferences="${freeMarkerPortletPreferences}" /> 
     </div> 
    </nav> 
</#if> 
</div> 

<#assign VOID = freeMarkerPortletPreferences.reset() /> 

답변

1

나는 내 사용자 지정 테마 (테마 생성기를 사용하여 스타일이 적용된 테마에서 시작하는 것과 같은 문제를 가지고 발견 :

가 나는뿐만 아니라 일반 사용자를 위해 그것을 숨길 다음으로 교체

<h2 class="portlet-title-text">${portlet_title}</h2> 

클래식 테마의 portlet.ftl가 있습니다 :

<#if portlet_display.getPortletDecoratorId() != "barebone"> 
     <h2 class="portlet-title-text">${portlet_title}</h2> 
    </#if> 
)가 portlet.ftl 파일은 라인을했다

#if 문을 h2에서 my portlet.ftl에 추가 했으므로 Barebone이 포틀릿에 선택된 데코레이터 인 경우 제목이 표시되지 않습니다. 이것은 Barebone이 템플릿을 통하거나 관리자의 Look and Feel 메뉴를 통해 설정 되든 관계없이 작동합니다.

+0

Mucho gracias! 코드를이 간단한 방법으로 업데이트합니다! –

0

navigation.ftl에서 코드 : 위의 솔루션은 관리자로만 로그인했을 때 작동했습니다.

section#portlet_com_liferay_site_navigation_menu_web_portlet_SiteNavigationMenuPortlet.portlet h2.portlet-title-text { display:none !important; }

+0

소스를 업데이트하면 템플릿 파일에이 클래스가 적용된 행운을 빕니다. –