Thursday, July 12, 2012

Hook To Modify Dockbar Portlet :


-      Adding language selection to liferay dockbar.

-      Screen shot :
       

-      Steps:
-      liferay-hook.xml:
<hook>
       <custom-jsp-dir>/META-INF/custom_jspscustom-jsp-dir>
hook>

-      Copy view.jsp from  liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23\webapps\ROOT\html\portlet\language
-      Paste view.jsp in to our hook at myfirsthook-hook\docroot\META-INF\custom_jsps\html\portlet\dockbar
-      Edit it :
-      Add line after toggle control :

<li class="aui-toolbar-separator">
              <span>span>
              li>
              <liferay-ui:language displayStyle="0" />
              <li class="aui-toolbar-separator">
              <span>span>
              li>



-      It will display all the languages as shown in Fig.

-      Try chaning to
-      <liferay-ui:language displayStyle="1" />
-      <liferay-ui:language displayStyle="2" />
-      <liferay-ui:language displayStyle="3" />


        



 
-      To add particular language :
<%
              String[] mylangaugesIds= {"en_US","hi_IN"};
              %>
             <liferay-ui:language languageIds="<%=mylangaugesIds%>displayStyle="4" />




1 comment:

Ishmeet Dheer said...

How can we customize the portlet as ni instead of click add > more, ca we have the checkbox kind of thing for portlets?

Junit 5 Architecture

Modules in JUnit 5 : •         junit-jupiter-api: This module defines the API that you need to write your tests. •         ...