I dug around and found the title is generated by the layout jsps
So quick and dirty is to replace that value
create a new layout id and clone and change the default set.
But a much nicer way would be to have a page title property
set in the deployment xml file.
deployment/page elment would have (optional)
deployment/portal should have a default
page.title (in case the page didn't define one)
This way you get flexible global portal title or individual page titles
This may already be doable, if someone could explain what objects are available in the layout jsps (e.g. how can one access Page properties?)
It should be possible to write a jsp expression using the request attribute "PAGE" (LayoutConstants.ATTR_PAGE), which is of type org.jboss.portal.theme.page.PageResult . Use the getPageName() method on the PageResult. That should give you the name of the page as is was specified in the deployment descriptor, or in the admin UI.
Disclaimer: Not tested ;)
I tried your suggestion and I get an error:
An error occurred at line: 9 in the jsp file: /layouts/generic/index.jsp
Generated servlet error:
LayoutConstants.ATTR_PAGE cannot be resolved to a type
This is what the beginning of my index.jsp page looks like:
Do you see any obvious mistakes?
I know you said it was untested . . . I just wondered if I was doing anything obviously wrong.
The following works (+ i18 support):
<jsp:directive.page import="org.jboss.portal.theme.page.PageResult"/> <jsp:directive.page import="org.jboss.portal.theme.LayoutConstants"/> <%@ taglib prefix="fmt" uri="/WEB-INF/fmt.tld"%> <% PageResult pageResult = (PageResult)request.getAttribute(LayoutConstants.ATTR_PAGE); String pageNameKey = "PAGENAME_" + pageResult.getPageName(); %> <fmt:bundle basename="conf.bundles.Resource"> <title><fmt:message key="<%=pageNameKey%>" /></title> </fmt:bundle>