Changing the Default Title or Description of a Portlet System-wide

The title of a portlet is determined by the language properties files and may be changed system-wide by using a language ext properties file similar to portal-ext.properties.

Resolution

To demonstrate how to change the portlet titles, this article we will seek to change the title of "Message Boards" to "Forums" in the English language file.

Locate the Default Language File

  1. To locate the default language file navigate to the web server folder in which Liferay is deployed. Normally this is ROOT.
  2. Navigate to ROOT/WEB-INF/lib
  3. In this folder locate the portal-imp.jar file and open it with an archive manager.
    • Put the portal-imp screenshot here
  4. In this jar, navigate to the content folder.
  5. In the content folder locate the language_*properties file where "*" is the two character abbreviation for the language to be modified
  6. Extract this file

Next, we need to locate the property being modified. This file is the default settings file for the English language translation of Liferay. To change any language setting we must first locate the property setting in this file.

Locate the Property Settings

  1. Open language_*properties file in a text editor
  2. Under the "Portlet descriptions and titles" section find the default portlet title you wish to modify
    • In this case we are looking to modify the Message Boards title
      javax.portlet.title.19=Message Boards

Finally, we must create and place the ext file with the proper modifications

Make the Modifications

  1. Create a file called language-ext_*properties where the * is the two character abbreviation for the language file being modified.
    • In our case: language-ext_en.properties
  2. Paste the default settings you wish to modify in this file
    • javax.portlet.title.19=Message Boards
  3. Make the desired modifications to this property
    • javax.portlet.title.19=Forums
    • If this is the only property being modified then this should be the only line in the file
  4. Save this file
  5. Navigate to ROOT/WEB-INF/classes folder
  6. Create a folder here titled "content"
  7. Place the language-ext_*properties file in the content folder
    • put the language-ext screenshot here
  8. Restart the application server

At this point, you should have successfully changed the title.

这篇文章有帮助吗?
0 人中有 0 人觉得有帮助