Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Gwowen Fu
How to show portlet name instead of ID in Add application list?
6 de Julho de 2012 14:17
Resposta

Gwowen Fu

Ranking: Expert

Mensagens: 253

Data de entrada: 27 de Dezembro de 2010

Mensagens 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
David H Nebinger
RE: How to show portlet name instead of ID in Add application list?
6 de Julho de 2012 15:48
Resposta

David H Nebinger

Ranking: Liferay Legend

Mensagens: 6233

Data de entrada: 1 de Setembro de 2006

Mensagens recentes

Um, you need to use liferay-display.xml to specify how it appears in the add app list.
Hitoshi Ozawa
RE: How to show portlet name instead of ID in Add application list?
7 de Julho de 2012 08:15
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7990

Data de entrada: 23 de Março de 2010

Mensagens 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.
Gwowen Fu
RE: How to show portlet name instead of ID in Add application list?
11 de Julho de 2012 08:47
Resposta

Gwowen Fu

Ranking: Expert

Mensagens: 253

Data de entrada: 27 de Dezembro de 2010

Mensagens 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
Anexo

Anexos: Screenshot-2012-07-11_10.46.29.png (10,0k)
David H Nebinger
RE: How to show portlet name instead of ID in Add application list?
11 de Julho de 2012 08:53
Resposta

David H Nebinger

Ranking: Liferay Legend

Mensagens: 6233

Data de entrada: 1 de Setembro de 2006

Mensagens 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
RE: How to show portlet name instead of ID in Add application list?
11 de Julho de 2012 09:21
Resposta

Gwowen Fu

Ranking: Expert

Mensagens: 253

Data de entrada: 27 de Dezembro de 2010

Mensagens 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