legacy-knowledge-base
公開されました 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

learn-legacy-article-disclaimer-text

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