Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:40:01+00:00 2026-05-28T00:40:01+00:00

We have several sites hosted on a Liferay 5.2 instance, consisting of multiple communities,

  • 0

We have several sites hosted on a Liferay 5.2 instance, consisting of multiple communities, themes, and layout templates, all working as expected. However, this setup is no longer working in the EE service packs of 5.2 (specifically, the latest EE SP5 – same as 5.2.9) or the latest 6.0.6 (CE). (Additional testing showed that this was last working in EE SP3 / 5.2.7, but became an issue in EE SP4 / 5.2.8.) We urgently need to upgrade to the latest 5.2 service pack (EE SP5) to address other issues – but upgrading to Liferay 6 is also a possible option, as long as we can find a combination of a solution and version that works.

In particular, we have files in the theme (e.g. inc-side.vm) that are included as part of the theme, and included by the layout templates. This allows for content to be “owned” by the theme, but used in context of the various layout templates – even though the same layout templates are used across multiple sites (communities / themes). Placing this content directly in the theme (without involving the layout template) is not an option, as it needs to be placed within the UI space of the layout, and various layouts may require this content to be located in different spaces in respect to the theme.

An additional requirement is that this included content must consist of “embedded” portlets – I.E., is not drag-and-dropped into the UI per-page, but is associated with each theme / layout. By simply applying the theme + layout to a site / page, the correct portlets are automatically included on each page. This is necessary as with some of the sites / communities consisting of around 100 or more pages, adding this content per-page and keeping it consistent without being embedded in the theme + layout would not be practical nor maintainable. (Consider just 10 themes (communities) * 10 layout templates * 10 pages / community = 1,000 combinations to configure and maintain.)

Again, this was all working under 5.2.3 (including 5.2 EE SP1, SP2, and SP3) – but stopped working as of 5.2 EE SP4. We are a Liferay enterprise support customer, and have had a support ticket open for almost 2 months with no resolution on this yet provided. Nothing was mentioned concerning this in the release notes, and we have not yet been able to obtain any guidance from Liferay as to why this changed, or any successful work-arounds.

Here are some specifics for the current issue:

Easily and consistently reproducible under any new installation of 5.2 EE SP4 or SP5.

Include inc-side.vm under the templates directory in the theme. There is nothing special about the theme – even using a copy of Liferay’s default “classic” theme will work.

In inc-side.vm, include the following:

<p>Before Diagnostics</p>
$theme.runtime("27_INSTANCE_0000", "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()
<p>After Diagnostics</p>

Note that “27” is a default Liferay-provided portlet, used for simplicity, and to demonstrate that this issue is not particular to any custom-developed portlet. However, I’ve also created my own “diagnostics portlet” from scratch that demonstrates exactly the same issue.

In the layout template (*.tpl), include the following lines:

#set ($contextName = $themeDisplay.getTheme().getContextPath())
#set ($themeContext = $request.getAttribute("CTX").getContext($contextName))
#evaluate ($theme.include($themeContext, "/templates/inc-side.vm"))

This follows the same approach shown at http://www.liferay.com/community/forums/-/message_boards/message/772138 .

Per a suggestion from our support ticket, I also tried the following 1-line alternative to the above lines:

#parse ("$fullTemplatesPath/inc-side.vm")

(Note $fullTemplatesPath vs. $full_templates_path. The reason for this is that init.vm calls #set ($full_templates_path = $fullTemplatesPath) – but init.vm is not included in the templates, only the theme.)

The results for either approach are identical. Any static text / HTML contained within inc-side.vm are displayed as expected. Any Velocity directives are parsed and processed, and not displayed in the output. Logging within the portlet shows that it has executed, and even retrieves any portlet preferences that were set to velocityPortletPreferences. The root problem is that any content generated by the portlet is not being rendered to the HTTP response. In fact, as viewed by Firefox’s “View/Source” or cURL, the response contains exactly:

<p>Before Diagnostics</p>
<p>After Diagnostics</p>

In my custom portlet, I even tried calling every flush() and close() method I could find on the response, thinking it was a flushing-related issue.

Testing under Liferay 6.0.6 instead (assuming maybe this was only a 5.2-series issue) gives yet different but interesting results. The included *.vm file is successfully read into the page. However, it is not being evaluated as Velocity code. Unlike in 5.2 SP5 where the included VM is being executed but just not rendering, 6.0.6 is rendering but not evaluating (or executing).

We have reviewed http://www.liferay.com/web/raymond.auge/blog/-/blogs/11180056 (“Embedding portlets in themes on Liferay”), and the above approach is really “method one”. “Method two” is not an acceptable option, as the use of an <iframe> causes issues with the DOM of the page (specifically with JavaScript IPC) – and this would also require the UI size of each portlet to be known in-advance, which isn’t practical or acceptable.


We are hoping that someone more familiar with Liferay and/or the Apache Velocity templating engine (used by Liferay) can provide a resolution or other acceptable work-around to this issue. I will provide any additional details or clarifications that I can.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:40:02+00:00Added an answer on May 28, 2026 at 12:40 am

    This issue is resolved by Liferay patch lpe5096-ee5209-portal-kernel-jdk6.jar. The one I’m using effectively was provided by Liferay on 2011-12-29, and has a SHA-1 checksum of adb6e0590bfc4850c127a792515941d6de5d385e.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have several web sites on my web server, all as applications
I have read several sites and they all say to upload the app, but
I have several sites I'm working on that are loading sub-pages via lightbox. The
I have several sites (Asp.Net) that I would like to have a single sign
I have several sites in different domains: example.com , example.org , mail.example.com and passport.example.org
I have several sites that I want to link back to the main site
I have several web pages on several different sites that I want to mirror
I have seen several sites where these social share buttons looks perfectly horizontal aligned.
I have several ASP.NET sites in IIS7 and would like to be able to
I have looked through several sites for any useful documentation and have come up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.