Liferay v6.1 introduced a new end-user customization capability wherein we can create a customizable page in a site that allows an end-user to add or remove portlets on the page or drag and drop portlets in different places on the page. In order to enable customization for a page, just go to Control Panel -> Site pages -> Select the page -> Customization Settings (or navigate to the page in question and select Manage Page in the dockar and choose Customization Settings), check the sections on the page that can be customized, and save the changes. Here’s a screenshot of the Customization Settings screen:

Now login as a regular site member (non-admin), open this page, and you will see a new line on the top of the page:


This enables the user to add/remove portlets or drag and drop the portlets to different places on the page like this:


But at the same time, we probably don’t want to allow the end-user to perform certain changes:

  1. Re-configure the portlets on the page using the portlet configuration mode; note that by default, once you enable end-user customizations, Liferay does not enforce the portlet “configuration” permission and allows the end-user to configure all portlets in the customizable area even though the end-user should not be allowed to.
  2. Edit the portlet title for any portlet on the page


To disable the portlet configuration option for common users, we can add two lines of code in the “portlet.vm” file in the theme and update the theme:

            #if ($portlet_display.isShowBackIcon())
<a class="portlet-icon-back" href="$portlet_back_url">#language("return-to-full-page")</a>
   #if ( ($permissionChecker.isCompanyAdmin() ) )

To make portlet titles non-editable to the common users, login as administrator, go to Control Panel -> Site pages -> Select the page -> JavaScript, add the following javascript code on that page:

AUI().ready("aui-base", "event", "liferay-layout", "aui-node", "liferay-service",function(A) {
userId: themeDisplay.getUserId(),
name: "Administrator",
inherited: false
function(message) {
var exception = message.exception;
if (!exception) {
if (message != true) {
var portlets = Liferay.Layout.getPortlets();
for(var i = 0; i < portlets.size(); i++) {
var portlet = portlets.item(i);
var portletNode ='#p_p_id_' + portlet.portletId + "_");
var title ='.portlet-title-text');
} else return;
else return;

Now the site member is not able to re-configure the portlets and change the portlet titles on a customizable page unless he/she is a site admin. If you want more granular control on who can edit portlet titles and configure portlets (and not just admins), it is doable but requires a little more work.

Share This