Foren

Where to change portlet title in the xml?

Dean Grobler, geändert vor 12 Jahren.

Where to change portlet title in the xml?

thumbnail
Juhi Kumari, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml?

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi Dean,

You can change it in Language-ext.properties file.

Regards
Juhi
Dean Grobler, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml?

thumbnail
Juhi Kumari, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml?

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi Dean,

You can find Language-ext.properties file in src\content folder.


Regards
Juhi
Dean Grobler, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml?

thumbnail
Tejas Kanani, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml?

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
For Language_en.properties to be created, you will have to mention it in portlet.xml.
Just add below bold lines in portlet.xml and redeploy the portlet, you'll see content\Language_en.properties file.


.....
......
<supports>
		<mime-type>text/html</mime-type>
</supports>
[b]<supported-locale>en</supported-locale> 
<resource-bundle>content.Language</resource-bundle>[/b]
<portlet-info>
.....
.....
</portlet-info>
thumbnail
Juhi Kumari, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml?

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi,
Under src folder you will get com,content and META-INF folder. BTW which version of liferay you are using??

Regards
Juhi
thumbnail
Tejas Kanani, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml? (Antwort)

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
Hi Dean,

You can change it from portlet.xml only.
Just change display-name and portlet-info.


<portlet>
	<portlet-name>medeloggetadmin</portlet-name>
	[b]<display-name>Medelog-Get Administration</display-name>[/b]
         ....
         .....
	[b]<portlet-info>
		<title>Medelog-Get Administration</title>
		<short-title>Medelog-Get Administration</short-title>
		<keywords>Medelog-Get Administration</keywords>
	</portlet-info>[/b]
         ......
</portlet>


I hope this is what you are looking for.
Dean Grobler, geändert vor 12 Jahren.

RE: Where to change portlet title in the xml?

thumbnail
Neetu Mishra, geändert vor 11 Jahren.

RE: Where to change portlet title in the xml?

Junior Member Beiträge: 75 Beitrittsdatum: 21.05.12 Neueste Beiträge
Hi Dean & Tejas,

I am using liferya 6.1. I want to change portlet title on the basis of language selected by the user. I know how to change the portlet contents but didn't get any solution to change the title of the portlet.

Do you guys have any input?? or Can anyone else help me regarding this??

Thanks in advance!!


Regards,
Neetu
thumbnail
Tejas Kanani, geändert vor 11 Jahren.

RE: Where to change portlet title in the xml?

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
Hi Neetu,

I hope I am not too late. emoticon
Try this,

In your portlet.xml add your supported-locale. In below code I am adding Hindi.

<supports>
	<mime-type>text/html</mime-type>
	<portlet-mode>view</portlet-mode>
</supports>
[b]<supported-locale>hi_IN</supported-locale>[/b]
<resource-bundle>content/Language</resource-bundle>
<portlet-info>
	<title>HiWorld</title>
	<short-title>HiWorld</short-title>
	<keywords></keywords>
</portlet-info>


Now inside your portlet under docroot\WEB-INF\src\content, create Language<supported-locale>.properties(Language_hi_IN.properties). And add javax.portlet.title property with the value you want to display when you select your locale.
javax.portlet.title=भाषा


And now select Hindi as your language. And you'll see your portlet title gets changed with Hindi language title.

HTH

Regards,
Tejas
thumbnail
Neetu Mishra, geändert vor 11 Jahren.

RE: Where to change portlet title in the xml?

Junior Member Beiträge: 75 Beitrittsdatum: 21.05.12 Neueste Beiträge
Thanks a lot Tejas!!

I got the answer in this post as well but didn't knew about
<supported-locale>hi_IN</supported-locale>
. So thanks once again.



Regards,
Neetu