Legacy Knowledge Base
Published Jun. 30, 2025

Embedding a custom Portlet into a Liferay Web Content Article

Written By

Koustuv Dhani

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • How to embed a custom MVC portlet into Liferay Web Content Article

Environment

  • Liferay DXP 7.4

Resolution

  • Liferay DXP offers a powerful Taglib with a special tag <@liferay_portlet["runtime"]>  , which allows the embedding of a specific MVC portlet directly into a Web Content article.
  • Navigate to Site Administration > Content & Data > Web Content, and create a new structure as per requirement.
  • Then navigate to the Template section and select the desired structure from the Properties tab located on the right side of the editor. This structure will be used for the template.
  • Add the following Liferay portlet Taglib within the template:
  • <div id="embedded-welcome-portlet-example">
    <@liferay_portlet["runtime"]
    defaultPreferences=""
    instanceId="vwyk"
    portletName="TestPortlet"
    queryString="" />
    </div>
  • After adding the tag, ensure that the correct instanceId and portletId of the portlet are provided within the code and ensure they match the actual values assigned to the portlet in your Liferauy Instance.
  • Finally, create new web content with structure and template, publish it into a page, and verify the result to ensure the portlet displays correctly.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base