3

I have created a theme in liferay 6.1. Now my question is how do I change the title of the theme pages. For ex: About us page has title "Aboutus -liferay", I want to change it to "Aboutus".

I have tried using javascript for this like: document.title="aboutus";

But until the page loads it shows the default title(Aboutus-liferay) and then after page load this "aboutus" title appears.

I want the custom title. Any help is highly appreciated.

Sachin Prasad
  • 5,365
  • 12
  • 54
  • 101
Milople Inc
  • 399
  • 1
  • 8
  • 34

3 Answers3

2

I just added:

**<head>
    <title>$the_title</title>
 </head>**

in my portal_normal.vm file and this solved my problem. Now whatever title i add in my html title of the pages in Manage Pages --> pages gets displayed in the title.

Milople Inc
  • 399
  • 1
  • 8
  • 34
0

Edit the title inside portal_normal.vm of your theme.

adarshr
  • 61,315
  • 23
  • 138
  • 167
0

In portal_normal.vm, which is a velocity file, add your title to the following code snippet :

<head>
    <title>your_title</title>
</head>

EDIT

If you are talking about JSP pages, you can use:

com.liferay.portal.util.PortalUtil.setPageTitle(String, title, HttpServletRequest request);

in the respective page body.

TechSpellBound
  • 2,505
  • 6
  • 25
  • 36
  • 1
    @GarthHuff `portal_normal.vm` is inside the theme. Usually multiple pages will be assigned to a single theme. If not, you'll have to do this for all the themes you have installed. Definitely not for all the pages. – adarshr Jan 09 '13 at 11:44
  • Ya you are absoultly correct. I have added the correct syntax to be added in the portal_normal.vm. Thanks for your help. – Milople Inc Jan 09 '13 at 11:54