开发者

what is the easiest way to filter articles in liferay theme

开发者 https://www.devze.com 2023-02-27 03:47 出处:网络
Excuse me if I\'m asking silly or easy question, but I just can\'t figure it out. So, I have a theme, I want to render only portlets, skipping any journal articles.

Excuse me if I'm asking silly or easy question, but I just can't figure it out. So, I have a theme, I want to render only portlets, skipping any journal articles. Which is the most appropriate开发者_StackOverflow way to do it?


In your theme's resources, there is a portlet.vm template available in the _diffs/template directory. This template allows you to override the default presentation of portlets in general (e.g. change the configuration icons, remove the title bar, ...).

However, inside portlet.vm Liferay injects a predefined variable called $portletDisplay. This is an instance of the com.liferay.portal.theme.PortletDisplay class and represents the portlet that is currently printed.

You can use the $portletDisplay.portletName attribute to check for 56, which is the ID for all Web Content Display portlets. So, in short, encapsulate the parent <div> inside portlet.vm with the following condition:

#if($portletDisplay.portletName == '56')
<div class="portlet" ...>
    ...
</div>
#end
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号