<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Adding Widgets to Page Fragments</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111312673" />
  <subtitle>Adding Widgets to Page Fragments</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111312673</id>
  <updated>2026-04-03T18:17:01Z</updated>
  <dc:date>2026-04-03T18:17:01Z</dc:date>
  <entry>
    <title>RE: Adding Widgets to Page Fragments</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119704740" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119704740</id>
    <updated>2020-08-04T18:47:00Z</updated>
    <published>2020-08-04T18:47:00Z</published>
    <summary type="html">Here&amp;#39;s a list of tags:&lt;br /&gt;&lt;a href="https://help.liferay.com/hc/en-us/articles/360020757071-Embedding-Widgets-in-Page-Fragments"&gt;https://help.liferay.com/hc/en-us/articles/360020757071-Embedding-Widgets-in-Page-Fragments&lt;/a&gt;</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-08-04T18:47:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Adding Widgets to Page Fragments</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119705368" />
    <author>
      <name>Dave Kliczbor</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119705368</id>
    <updated>2020-08-04T16:28:00Z</updated>
    <published>2020-08-04T16:28:00Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;What I found out about this:&lt;br&gt;&lt;ol style="list-style: decimal outside;" start="1"&gt;&lt;li&gt;Browse to &lt;a href="https://github.com/liferay/liferay-portal"&gt;https://github.com/liferay/liferay-portal&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Press T&lt;/li&gt;&lt;li&gt;Enter the Portlet Class file name("LoginPortlet.java")&lt;/li&gt;&lt;li&gt;Look for the value of the @Component property "com.liferay.fragment.entry.processor.portlet.alias"&lt;/li&gt;&lt;li&gt;Prefix that value with "lfr-widget-", then you've got your tag name.&lt;/li&gt;&lt;li&gt;Realize that the @Component property for LoginPortlet from step 4 is not there.&lt;/li&gt;&lt;li&gt;Go to &lt;a href="https://issues.liferay.com"&gt;https://issues.liferay.com&lt;/a&gt; and file a bug.&lt;/li&gt;&lt;li&gt;Wait one or two Liferay releases.&lt;/li&gt;&lt;li&gt;Redo 1-5, then continue developing.&lt;/li&gt;&lt;/ol&gt;I just went through the same problem as you, except that I found out that for a Portlet to be accessible using &amp;lt;lfr-widget-*&amp;gt;, the Portlet class needs to have the @Component property mentioned above.&lt;br&gt;BUT, there is an alternative way to get a portlet into a page fragment (which even gives you the opportunity to preconfigure it -- just omit the preferences parts if you don't need that):&lt;br&gt;&lt;pre&gt;&lt;code&gt;[code]&amp;lt;div class="fragment-12345"&amp;gt;
  [#assign assetPublisherPortletPreferences="&amp;lt;portlet-preferences&amp;gt;
    &amp;lt;preference&amp;gt;
        &amp;lt;name&amp;gt;delta&amp;lt;/name&amp;gt;
        &amp;lt;value&amp;gt;12&amp;lt;/value&amp;gt;
    &amp;lt;/preference&amp;gt;
&amp;lt;/portlet-preferences&amp;gt;" /]
  [@liferay_portlet["runtime"]
    instanceId="${fragmentEntryLinkNamespace}assets"
    portletName="com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet"
    defaultPreferences="${assetPublisherPortletPreferences}"
  /]
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;The info that's nowhere to be found (unless you read Liferays source code) is that Page Fragments' HTML actually is processed by Freemarker, &lt;em&gt;but only &lt;a href="https://freemarker.apache.org/docs/dgui_misc_alternativesyntax.html"&gt;Freemarkers alternative syntax&lt;/a&gt; i&lt;/em&gt;s allowed here. So, we can make use of Liferay taglibs here, which puts the tag &lt;pre&gt;&lt;code&gt;&amp;lt;liferay-portlet:runtime&amp;gt; &amp;lt;/liferay-portlet:runtime&amp;gt;&lt;/code&gt;&lt;/pre&gt;in our reach.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Dave Kliczbor</dc:creator>
    <dc:date>2020-08-04T16:28:00Z</dc:date>
  </entry>
  <entry>
    <title>Adding Widgets to Page Fragments</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111312672" />
    <author>
      <name>Nick Burton</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111312672</id>
    <updated>2018-10-24T17:15:47Z</updated>
    <published>2018-10-24T17:15:47Z</published>
    <summary type="html">Sorry if this is obvious ...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Question:&lt;/strong&gt;  Where/how do I find the registered Alias for each widget?&lt;br /&gt;&lt;br /&gt;For example, I have tried to add &amp;lt;lfr-widget-login&amp;gt;&amp;lt;/lfr-widget-login&amp;gt; for the Login Widget, but the screen simply displays &amp;#8212; &amp;#34;There is no widget available for alias login&amp;#34;.&lt;br /&gt;I don&amp;#39;t know how to find the correct registered Alias for each widget/portlet.&lt;br /&gt;&lt;br /&gt;Thanks in advance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Nick</summary>
    <dc:creator>Nick Burton</dc:creator>
    <dc:date>2018-10-24T17:15:47Z</dc:date>
  </entry>
</feed>
