Question

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.

Était-ce utile?

La solution

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.

Autres conseils

Edit the title inside portal_normal.vm of your theme.

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top