Wednesday, August 22, 2012

Hiding the Header bar of Alfresco Share portlets in Liferay

Recently I was creating a demo for one of our customers who wanted to use Share portlets in Liferay.

Environment: Alfresco 4.0.2, Liferay 6.1.0

The Share portlets were easily deployed and working in Liferay. However, the default Share header bar was not expected inside the portlet.

It was presented like there are two navigation bars in your screen - one is from Liferay navigation, another of Share Header.

Thus I needed to get rid of the header, but since the same page as of Share application is used in the portlet container as well, I couldn't simply get rid of the header.

Added a few lines in site-webscripts/org/alfresco/header.get.html.ftl file.

<#assign portlet = context.attributes.portletHost!false>
<#if portlet>
    <#assign todo="we are not displaying header in portlet context. so nothing to do">
    <#-- The original Header generator FTL code goes here -->

It made the header bar not rendered while in Portlet, but the bar was as usual displayed in the Share application.


  1. Thanks for your helpful post. Alfresco 4.0.2 version is a Community Version? I've found Alfresco Share Portlets version 4.0.e for Liferay 5.2.3 and not for Liferay 6.1.0.

  2. Alfresco 4.0.2 is an Enterprise edition.
    However, 4.0.e works in the similar way in this context.

    Also, the portlets works in both Liferay 5.2.3 and 6.1.0. For deployment of these portlets please see

  3. Hi,

    I succeeded in integrating Alfresco Share with Liferay.

    The versions I used for this integrations are as follows:

    1. Alfresco - alfresco-enterprise- (30-day Trial)
    2. Liferay - liferay-portal-6.1.1-ce-ga2

    I followed the instructions given in the URL:

    Everything went fine. But, at present I am looking for solutions for 2 issues which I am facing currently.

    Issue #1: I am not able to use the any of the following features of Share: Site Document Library.

    i. Create Content
    ii. New Folder
    iii. Upload

    All these buttons are disabled even though I logged in as a user who has site permission in both Alfresco and Liferay.

    Issue #2: I want to hide two header bar of the share portlet

    i. Header bar #1: (Site Dashboard, Library, Members)
    ii. Header bar #2: (My Dashboard, Sites, People, Repository, More..)

    I attempted to resolve the issue by following the instructions given in this URL:

    But, for a strange reason I ended up in crashing the alfresco setup (I was not able to login into alfresco). I ended up re-installing alfresco from the scratch.

    Please suggest me a solution.

    Thanks in advance.

    1. Hi Mari

      Issue #1
      Have you made sure you have same user credential in Liferay and Alfresco? Specially check the Liferay screen name (I am assuming you are logging in Liferay with screen name, not with email id) and Alfresco user name.
      Also, please re-check all the steps for deploying the Share portlets in Liferay as in

      Issue #2
      I am sure these changes in the FTL files have not triggered the crashing of alfresco. You might test these FTL code in a stand alone alfresco instance (without Liferay integration), just to make sure these code is not breaking your setup. And also, rolling back these changes should make your setup run again properly, if these changes are affecting your setup at all.

      Let me know if this helps.

  4. Hi Snig,

    Thanks for your time for replying my mail.

    Please find my below comments.

    Issue #1:
    I am using the correct credentials in Liferay and Alfresco. After seeing your reply I even tried setting the in to login in Liferay using the screen name but still I am facing the same issue.

    Issue #2:
    I will verify the FTL code in standalone Alfresco environment as you suggested.

    Please let me know if you have any further thought on this issue #1.

    Thanks in advance,

    1. Hi Mari

      Sorry for the delayed reply.
      However, in terms of Issue #1, does your app server (tomcat etc) throwing any error message? If not, you may want to check the log4j setting for the class, and increase the log level.
      Can you see the corresponding page correctly in Alfresco Share interface, with the same user name?


  5. SQIAR ( is a leading Business Intelligence company and provides Tableau tutorial in United Kingdom and USA