Embedding a Portlet by Portlet Name

If you’d like to embed a specific portlet in the theme, you can hard code it by providing its instance ID and name. Follow these steps:

  1. Open the FreeMarker theme template that you want to embed the portlet in. (portal_normal.ftl is a good choice.

  2. Add the liferay_portlet["runtime"] macro to the template, as shown below. The portlet name must be the same as javax.portlet.name’s value.


Here’s an example of an embedded portlet declaration that uses the portlet name to embed a web content portlet:


Great! Now you know how to embed a portlet in your theme’s by their name and ID.

« Embedding Portlets in Themes by Entity Type and ActionSetting Default Preferences for an Embedded Portlet »