This content has been marked as final.
Show 2 replies
-
1. Re: Portal title
trong.tran Sep 10, 2010 12:57 PM (in response to world.quake)there is a topic that talks about changing the portal page title in a portlet http://community.jboss.org/message/555247
could it help ?
-
2. Re: Portal title
world.quake Sep 21, 2010 4:54 AM (in response to trong.tran)I have found the solution for my entire problem:
import org.exoplatform.portal.webui.util.Util;
String title;
try {
title = Util.getPortalRequestContext().getTitle();
} catch (Exception e) {
throw new IllegalStateException(response + " cannot be used to set title", e);
}
Element element = response.createElement("title");
ELContext el = FacesContext.getCurrentInstance().getELContext();
ValueExpression ve = FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createValueExpression(el, title, Object.class);
title = ve.getValue(el).toString();
element.setTextContent("OurAppName - " + title);
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, element);This is the way to get and re-set the title in a phase listener. This is a way to i18n the title, and even to use el expressions in the page title desined in the xml. This code must run when the listenert called for the last portlet. Only RenderResponse response instance can do the trick.