<?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>freeMarkerPortletPreferences has evaluated to null or missing</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121677488" />
  <subtitle>freeMarkerPortletPreferences has evaluated to null or missing</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121677488</id>
  <updated>2026-04-03T22:28:20Z</updated>
  <dc:date>2026-04-03T22:28:20Z</dc:date>
  <entry>
    <title>RE: freeMarkerPortletPreferences has evaluated to null or missing</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121683794" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121683794</id>
    <updated>2023-03-30T16:00:13Z</updated>
    <published>2023-03-30T16:00:12Z</published>
    <summary type="html">&lt;p&gt;Yes, in 7.4 the syntax for embedding a portlet has changed... Try
  looking in the 7.4 themes for examples of the new syntax...&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2023-03-30T16:00:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: freeMarkerPortletPreferences has evaluated to null or missing</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121678217" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121678217</id>
    <updated>2023-03-23T12:43:53Z</updated>
    <published>2023-03-23T12:40:27Z</published>
    <summary type="html">&lt;p&gt;From a quick check, it looks like that API has changed dramatically.
  Your best and easiest bet might be to use the new standard
  &amp;quot;Master Page&amp;quot; to embed portlets on each page, instead of
  editing theme-side template code.&lt;/p&gt;
&lt;p&gt;What have I done in my quick check?&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;grep -r &amp;quot;freeMarkerPortletPreferences&amp;quot; $SRC&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which reveals a hit in &lt;a
      href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/portal-template/portal-template-freemarker/src/main/java/com/liferay/portal/template/freemarker/internal/helper/FreeMarkerTemplateContextHelper.java#L184"&gt;&lt;span style="font-family: monospace;"&gt;
      &lt;span
  style="color: rgb(0,0,0);background-color: rgb(255,255,255);"&gt;FreeMarkerTemplateContextHelper.java&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
  This line refers to &lt;a
  href="https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portal/template/TemplatePortletPreferences.java"&gt;TemplatePortletPreferences&lt;/a&gt;,
  which doesn't have any setValue method.&lt;/p&gt;
&lt;p&gt;Following that path (specifically in
  FreeMarkerTemplateContextHelper), you might find a replacement option
  (e.g. as used &lt;a
    href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/site-initializer/site-initializer-liferaybotics/src/main/resources/site-initializer/fragments/header-components/fragments/search-bar/index.html"&gt;in
  site-initializers&lt;/a&gt;), but my actual recommendation is to change your
  implementation and utilize Master Pages.&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2023-03-23T12:40:27Z</dc:date>
  </entry>
  <entry>
    <title>freeMarkerPortletPreferences has evaluated to null or missing</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121677487" />
    <author>
      <name>JP Vásquez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121677487</id>
    <updated>2023-03-22T16:01:57Z</updated>
    <published>2023-03-22T15:41:50Z</published>
    <summary type="html">&lt;p&gt;Hi,i have migrated a custom theme from Liferay 7.1 to Liferay 7.4.
  The theme deploys without any errors.&lt;br /&gt; In the theme, in
  portal_normal.ftl i have  a runtime portlet (JournalContentPortlet  to
  display an article)&lt;/p&gt;
&lt;p&gt;&amp;lt;#attempt&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;!--Al parecer no existe freeMarkerPortletPreferences en 7.4--&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;#assign VOID =
  freeMarkerPortletPreferences.setValue(&amp;quot;portletSetupPortletDecoratorId&amp;quot;,
  &amp;quot;barebone&amp;quot;) /&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;#assign VOID =
  freeMarkerPortletPreferences.setValue(&amp;quot;showListed&amp;quot;,
  &amp;quot;false&amp;quot;) /&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;#assign VOID =
  freeMarkerPortletPreferences.setValue(&amp;quot;targetPortletId&amp;quot;,
  &amp;quot;&amp;quot;) /&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;script&amp;gt;&lt;/p&gt;
&lt;p&gt;    console.log(${freeMarkerPortletPreferences})&lt;/p&gt;
&lt;p&gt;    &amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;div class=&amp;quot;col-11&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;        &amp;lt;@liferay_portlet[&amp;quot;runtime&amp;quot;]&lt;/p&gt;
&lt;p&gt;            defaultPreferences=&amp;quot;${freeMarkerPortletPreferences}&amp;quot;&lt;/p&gt;
&lt;p&gt;            portletProviderAction=portletProviderAction.VIEW&lt;/p&gt;
&lt;p&gt;            portletName=&amp;quot;gsearchminiportlet&amp;quot;&lt;/p&gt;
&lt;p&gt;        /&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;#assign VOID = freeMarkerPortletPreferences.reset() /&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;div class=&amp;quot;col-1 close-search-button-wrapper&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;        &amp;lt;@liferay_aui[&amp;quot;icon&amp;quot;]
  id=&amp;quot;close-search-button&amp;quot; image=&amp;quot;times&amp;quot;
  data={&amp;quot;show-id&amp;quot;: &amp;quot;body&amp;quot;}
  markupView=&amp;quot;lexicon&amp;quot; cssClass=&amp;quot;neo-hover
  pull-right&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;#recover&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;!-- Failed to load gsearch_search.ftl --&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/#attempt&amp;gt;&lt;/p&gt;
&lt;p&gt;        ${freeMarkerPortletPreferences.reset()}&lt;br /&gt;
  &lt;br /&gt; Im using freeMarkerPortletPreferences to set the runtime
  portlet preferences.&lt;br /&gt; Unfortunatelly i get an exception at the
  line  &amp;lt;#assign VOID =
  freeMarkerPortletPreferences.setValue(&amp;quot;portletSetupPortletDecoratorId&amp;quot;,
  &amp;quot;borderless&amp;quot;) /&amp;gt;&lt;br /&gt;
  &lt;strong&gt;The following has evaluted to null or missing:&lt;br /&gt; ==&amp;gt;
    freeMarkerPortletPreferences.setValue [in template
    &amp;quot;mytheme_SERVLET_CONTEXT_/templates/gsearch_search&amp;quot; at
    line 3, column 25]&lt;/strong&gt;
  &lt;br /&gt;
  &lt;br /&gt; Does anybody have any idea what might be the problem?&lt;br /&gt;  &lt;/p&gt;</summary>
    <dc:creator>JP Vásquez</dc:creator>
    <dc:date>2023-03-22T15:41:50Z</dc:date>
  </entry>
</feed>
