Fórum

How to show portlet name instead of ID in Add application list?

Gwowen Fu, modificado 11 Anos atrás.

How to show portlet name instead of ID in Add application list?

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
Hi,

I added my portlet id "myportlet_WAR_datamigrationplugin
" in portlet-ext.properties
dockbar.add.portlets=56,101,110,71,myportlet_WAR_datamigrationplugin

From the "Add" application list, it is listed as "java.portlet.title.myportlet_WAR_datamigrationplugin", not the display name I specified in portlet.xml.

How can that be done?

Thanks!
Gwowen
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: How to show portlet name instead of ID in Add application list?

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
Um, you need to use liferay-display.xml to specify how it appears in the add app list.
Gwowen Fu, modificado 11 Anos atrás.

RE: How to show portlet name instead of ID in Add application list?

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
David H Nebinger:
Um, you need to use liferay-display.xml to specify how it appears in the add app list.


Hi David,

I added "display-name" to liferay-display.xml and still ID is displayed.

<?xml version="1.0"?>
<display>
<category name="BSPN">
<portlet id="bspnlar">
<display-name>BSPN LAR Portlet</display-name>
</portlet>
</category>
</display>


Thanks!
Gwowen
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: How to show portlet name instead of ID in Add application list?

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
Gwowen Fu:
David H Nebinger:
Um, you need to use liferay-display.xml to specify how it appears in the add app list.


I added "display-name" to liferay-display.xml and still ID is displayed.


Display name is not a valid child of liferay-display.xml.

Liferay-display.xml is used to identify the category the portlet belongs in, and the <portlet id="xxx" /> reference will put that portlet under that category. There is no <display-name/> tag used in liferay-display.xml.

From there it goes to the portlet.xml file, and using the portlet id will look for the <display-name /> tag. There's also a <portlet-info /> tag in portlet.xml that has <title /> and <short-title /> tags that may also be used.
Gwowen Fu, modificado 11 Anos atrás.

RE: How to show portlet name instead of ID in Add application list?

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
David H Nebinger:

From there it goes to the portlet.xml file, and using the portlet id will look for the <display-name /> tag. There's also a <portlet-info /> tag in portlet.xml that has <title /> and <short-title /> tags that may also be used.

Yes, I also have name in portlet.xml file, that is what I tried first. If it is in category list then the portlet name is displayed but not in the Add menu.
The portlet section in portlet.xml.
<portlet>
<portlet-name>bspnlar</portlet-name>
<display-name>BSPN LAR</display-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>view-template</name>
<value>/view.jsp</value>
</init-param>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/classes/spring/larplugin-controller.xml</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>BSPN LAR</title>
<short-title>BSPN LAR</short-title>
<keywords>BSPN LAR</keywords>
</portlet-info>
</portlet>

Thanks!
Gwowen
thumbnail
Hitoshi Ozawa, modificado 11 Anos atrás.

RE: How to show portlet name instead of ID in Add application list?

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
Try placing your portlet in the "Add" menu. Check the console to make sure there isn't any error when you do.
Also, check if you don't have any misspelling.