Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide or disable Portlet for specfic languages in Liferay Portal

given there is a normal page with some portlets and the change language portlet. Is it possible to hide specific portlets for specific languages? Maybe via Portlet prefrences (only show for these locales....)?

Thanks in advance.

like image 762
Robert Kornmesser Avatar asked Nov 04 '22 07:11

Robert Kornmesser


1 Answers

you can use an if statement in your portlet and use following code:

<%ThemeDisplay themeDisplay = new ThemeDisplay();

String langid=null;
if(LanguageUtil.getLanguageId(request).equals("fa_IR"))
{
//display Farsi portlet
}
%>
<%=langid%>

or for better result you can use a switch statement

like image 183
user1313720 Avatar answered Dec 21 '22 16:12

user1313720