How to change the look and feel of embedded portlet?How to change the look and feel of embedded portlet?https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1177884872024-03-28T19:00:41Z2024-03-28T19:00:41ZRE: How to change the look and feel of embedded portlet?Alfonso Criscihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1178517862019-11-22T08:44:13Z2019-11-22T08:44:13Z<html><head></head><body>Hi Fabio, sorry for the delay, I was at DEVCON earlier this week. How about this (Velocity/tpl) approach?<br><pre><code><div class="my-liferay-layout" id="main-content" role="main">
&nbsp;&nbsp; &nbsp;<div class="portlet-layout row">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<div class="col-md-12 portlet-column portlet-column-only" id="column-1">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$velocityPortletPreferences.setValue("portletSetupPortletDecoratorId", "barebone")
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$theme.runtime("com_liferay_site_navigation_breadcrumb_web_portlet_SiteNavigationBreadcrumbPortlet", "",
$velocityPortletPreferences.toString())
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$velocityPortletPreferences.reset()
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</div>
&nbsp;&nbsp; &nbsp;</div>
</div>
</code></pre></body></html>Alfonso Crisci2019-11-22T08:44:13ZRE: How to change the look and feel of embedded portlet?Fabio Carvalhohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1178429942019-11-21T16:21:13Z2019-11-21T16:21:13Z<html><head></head><body>Ok. So I could not find any solution for my problem and I went back to velocity (tpl). I also found out that you can add breadcrumbs with:<pre><code>$theme.breadcrumb("", false, false, true, true)
</code></pre><br>I can't find any documentation for this. I suppose that the params are the same as the configuration options that the default Breadcrumb portlet have, but I am unsure about the first param (the String one).</body></html>Fabio Carvalho2019-11-21T16:21:13ZRE: How to change the look and feel of embedded portlet?Fabio Carvalhohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1178150662019-11-18T13:26:16Z2019-11-18T13:26:16Z<html><head></head><body>Hi Alfonso,<br><br>I could add the portlet with your solution, but I could not change the preferences this way. So I tried to change from tpl to ftl format and I could do something like this:<br><pre><code><div class="my-breadcrumb-css">
&nbsp; &nbsp; &lt;#assign preferences = freeMarkerPortletPreferences.getPreferences("portletSetupPortletDecoratorId", "barebone") /&gt;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &lt;@liferay_portlet["runtime"]
&nbsp; &nbsp; defaultPreferences="${preferences}"
&nbsp; &nbsp; &nbsp; &nbsp; portletName="com_liferay_site_navigation_breadcrumb_web_portlet_SiteNavigationBreadcrumbPortlet" /&gt;
</div>
<div class="my-column-css">
&nbsp; &nbsp; ${processor.processColumn("column-1", "portlet-column-content")}
</div>
</code></pre><br>The problem is that "liferay_portlet" is null or missing:<br><pre><code>
FreeMarker template error:
The following has evaluated to null or missing:
==&gt; liferay_portlet &nbsp;[in template "my_theme_CUSTOM_layout_simple" at line 5, column 27]----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use &lt;#if myOptionalVar??&gt;when-present&lt;#else&gt;when-missing<!--#if-->. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
--------
FTL stack trace ("~" means nesting-related):
&nbsp;&nbsp; &nbsp;- Failed at: @liferay_portlet["runtime"] defaultPr... &nbsp;[in template "my_theme_CUSTOM_layout_simple" at line 5, column 25]
----
</code></pre><br><br>Am I missing some include? How could this be missing?</body></html>Fabio Carvalho2019-11-18T13:26:16ZRE: How to change the look and feel of embedded portlet?Alfonso Criscihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1177955912019-11-15T18:45:09Z2019-11-15T18:45:09Z<html><head></head><body>Hi Ricardo,<br>No problem. Again, without testing myself, something like this might help:<br><pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $theme.runtime("mytest_INSTANCE_1234", "", "")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #set($VOID = $velocityPortletPreferences.reset())
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #set($VOID = $velocityPortletPreferences.setValue('portletSetupPortletDecoratorId', 'barebone'))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $theme.runtime("mytest_INSTANCE_1234", "", $velocityPortletPreferences.toString())
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #set($VOID = $velocityPortletPreferences.reset())
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $processor.processColumn("column-1", "portlet-column-content portlet-column-content-last")
</code></pre>Also, just as info, as of <a href="https://issues.liferay.com/browse/LPS-75190">https://issues.liferay.com/browse/LPS-75190</a>, layout templates can also be .ftl (Freemarker) instead of .tpl. You can change the file extension of file e.g. docroot/test.tpl to <strong>.ftl </strong>and the<strong> </strong>template-path to <strong>.ftl</strong> in the file docroot/WEB-INF/liferay-layout-templates.xml<strong></strong>.</body></html>Alfonso Crisci2019-11-15T18:45:09ZRE: How to change the look and feel of embedded portlet?Fabio Carvalhohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1177888892019-11-15T15:06:21Z2019-11-15T15:06:21ZHi Alfonso,<br /><br />Thanks for the answer. This code you quote works indeed in the ftl file format. But what I was looking for was for the tpl file. I know that I asked for ftl, but it was a mistake typing. I will edit the post.Fabio Carvalho2019-11-15T15:06:21ZRE: How to change the look and feel of embedded portlet?Alfonso Criscihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1177903182019-11-15T14:16:51Z2019-11-15T14:16:51Z<html><head></head><body>In Liferay 7, It should be possible in a way similar to this (I did not test yet):<br><pre><code>&lt;#assign preferences = freeMarkerPortletPreferences.getPreferences({"portletSetupPortletDecoratorId" : "barebone"}) /&gt;
&lt;@liferay_portlet["runtime"]
defaultPreferences="${preferences}"
portletName="com_liferay_site_navigation_breadcrumb_web_portlet_SiteNavigationBreadcrumbPortlet"
/&gt;
</code></pre><br>Docs: <a href="https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/applying-portlet-decorators-to-embedded-portlets">https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/applying-portlet-decorators-to-embedded-portlets</a></body></html>Alfonso Crisci2019-11-15T14:16:51ZHow to change the look and feel of embedded portlet?Fabio Carvalhohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1177884862019-11-15T12:28:03Z2019-11-15T12:28:03Z<html><head></head><body>Hi,<br><br>I have a custom-layout.tpl in my theme, and right now I am trying to add a BreadCrumb Portlet to my layout. To add it, I am doing like this:<br><pre><code&g