<?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>Portlet Decorator not working</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111679233" />
  <subtitle>Portlet Decorator not working</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111679233</id>
  <updated>2026-04-05T15:01:47Z</updated>
  <dc:date>2026-04-05T15:01:47Z</dc:date>
  <entry>
    <title>RE: Portlet Decorator not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111682136" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111682136</id>
    <updated>2018-11-27T17:07:31Z</updated>
    <published>2018-11-27T17:07:31Z</published>
    <summary type="html">&lt;p&gt;I would also add that I have sometimes found that you need to clear
  any existing preferences for your new ones to take effect. So let's
  say you have embedded the portlet in your theme and then loaded a
  page. The portlet preferences (the defaults) will now be saved in the
  PortletPreferences table so subsequent changes won't necessarily take
  effect. One sure fire way to make sure your changes DO take effect is
  to delete all the PortletPreference records that are specific to teh
  Search portlet. That will essentially clear it from all the layouts
  and since you are embedding the portlet, the (new) preferences will
  automatically be saved the next time you go to a page in your theme. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;You can delete the records directly from the table -- though this is
  never advised. If you do a direct &amp;quot;DELETE FROM ..&amp;quot;
  statement, then you should probably restart your server to make sure
  all the caches and such are expired/cleared. A better option though
  would be to script something in the Control Panel &amp;gt; Server
  Adminsitration &amp;gt; Script tab that uses the API to do the same thing.
  Going through the API also means you shouldn't have to restart the
  server since the API route will automagically clear/expire caches for you.&lt;/p&gt;</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2018-11-27T17:07:31Z</dc:date>
  </entry>
  <entry>
    <title>RE: Portlet Decorator not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111679617" />
    <author>
      <name>Rayappa Hattarwat</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111679617</id>
    <updated>2018-11-27T12:12:56Z</updated>
    <published>2018-11-27T12:12:56Z</published>
    <summary type="html">&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;I think assgin like this working in theme&lt;/p&gt;
&lt;p&gt;&amp;lt;#assign VOID =
  freeMarkerPortletPreferences.setValue(&amp;quot;portletSetupPortletDecoratorId&amp;quot;,
  &amp;quot;borderless&amp;quot;) /&amp;gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Rayappa&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt;  &lt;/p&gt;</summary>
    <dc:creator>Rayappa Hattarwat</dc:creator>
    <dc:date>2018-11-27T12:12:56Z</dc:date>
  </entry>
  <entry>
    <title>Portlet Decorator not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111679232" />
    <author>
      <name>Hamidul Islam</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111679232</id>
    <updated>2018-11-27T10:46:43Z</updated>
    <published>2018-11-27T10:46:43Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I have embedded search portlet in my custom theme. I am trying to
  apply my custom CSS&amp;nbsp;class to the embedded&amp;nbsp;search portlet. However, the
  CSS class is not getting applied to the portlet. Here are the steps I
  have followed&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;
  &lt;strong&gt;1. Define the portlet decorator:&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;In the&amp;nbsp;&lt;strong&gt;liferay&lt;/strong&gt;
  &lt;strong&gt;-look-and-feel.xml&lt;/strong&gt; file, I have mentioned the below&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;&amp;amp;nbsp;&amp;amp;lt;portlet-decorator id="&lt;/code&gt;
  &lt;code&gt;bnpsearch&lt;/code&gt;
  &lt;code&gt;" name="&lt;/code&gt;
  &lt;code&gt;bnpsearch&lt;/code&gt;
  &lt;code&gt;"&amp;amp;gt;&amp;lt;br&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;
    &amp;amp;lt;portlet-decorator-css-class&amp;amp;gt;portlet-bnp-search&amp;amp;lt;/portlet-decorator-css-class&amp;amp;gt;&amp;lt;br&amp;gt; &amp;amp;nbsp;&amp;amp;lt;/portlet-decorator&amp;amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  &lt;strong&gt;2. Define the CSS class .portlet-&lt;/strong&gt;
  &lt;strong&gt;bnp&lt;/strong&gt;
  &lt;strong&gt;-search :&amp;nbsp;&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;I have defined CSS class in &lt;strong&gt;_portlet_decorator.&lt;/strong&gt;
  &lt;strong&gt;scss&lt;/strong&gt; file and imported in&amp;nbsp;&lt;strong&gt;_custom.&lt;/strong&gt;
  &lt;strong&gt;scss&lt;/strong&gt;&amp;nbsp;as below&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;@import "corporate-templates/decorator/_portlet_decorator.scss";&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  &lt;strong&gt;3. Apply the decorator:&amp;nbsp;&amp;nbsp;&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;I have applied the decorator to the embedded&amp;nbsp;search portlet as follows&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;&amp;amp;lt;#assign preferences =
    freeMarkerPortletPreferences.getPreferences("portletSetupPortletDecoratorId", "&lt;/code&gt;
  &lt;code&gt;bnpsearch&lt;/code&gt;
  &lt;code&gt;") /&amp;amp;gt;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;br&amp;gt;
    &amp;amp;lt;@liferay.search default_preferences="${preferences}" /&amp;amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;After deploying the theme I should see the CSS class &lt;strong&gt;.portlet-&lt;/strong&gt;
  &lt;strong&gt;bnp&lt;/strong&gt;
  &lt;strong&gt;-search &lt;/strong&gt;as a wrapper for the search portlet. But it's
  not happening. Is there anything that I am missing in the above steps?
  Can anyone please help me.&amp;nbsp;&lt;/h4&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hamidul Islam&amp;nbsp;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Hamidul Islam</dc:creator>
    <dc:date>2018-11-27T10:46:43Z</dc:date>
  </entry>
</feed>
