Foren

how to create portlet show articles

Huy Nguyen, geändert vor 9 Jahren.

how to create portlet show articles

New Member Beiträge: 3 Beitrittsdatum: 09.06.14 Neueste Beiträge
Hi everyone, I am newbie with Liferay Porttal. I want to use Liferay to show news with three columns in one row, one columns contain following content:
row 1: Image
row 2: Title
row 3: Content
row 4: "Read more"
I found Asset Publisher portlet which can do my job but structure of interface is difference with what i want. Can anyone tell me how to customize Asset Publisher's interface to fix my need? or in case I want to create new portlet to read data that was created by using Asset Publisher portlet in database. How can I do it?
Thanks in advance!
thumbnail
Meera Prince, geändert vor 9 Jahren.

RE: how to create portlet show articles

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
Hi
You can customize Asset Publisher JSP pages as for your need using Hook or you can achieve through customize CSS from theme.
Another create new brand new portlet and use JournalArticleLocalServiceUtil java class have many methods to fetch articles.

Once you get list you can display in jsp pages the way you want..

Liferay Beginner follow http://liferaysavvy.com

Regards,
Meera Prince
http://liferaysavvy.com
thumbnail
Tejas Kanani, geändert vor 9 Jahren.

RE: how to create portlet show articles

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
Hi,

If you are using Liferay 6.2, I would say go with Application Display Template. A nice way to customize/have your own look and feel for Liferay OOTB portlet. This way you'll be using the Asset Publisher portlet itself with your UI needs.
Currently it supports below Liferay OOTB portlet.
  • Asset Publisher
  • Blogs
  • Categories Navigation
  • Media Gallery
  • Site Map
  • Tags Navigation
  • Wiki

Some References
https://www.liferay.com/web/eduardo.garcia/blog/-/blogs/new-ways-of-customization-with-application-display-templates-part-i-
https://www.liferay.com/web/eduardo.garcia/blog/-/blogs/new-ways-of-customization-with-application-display-templates-part-ii-
https://www.liferay.com/documentation/liferay-portal/6.2/user-guide/-/ai/using-application-display-templates-liferay-portal-6-2-user-guide-07-en

Hope this helps.

- Tejas
Huy Nguyen, geändert vor 9 Jahren.

RE: how to create portlet show articles

New Member Beiträge: 3 Beitrittsdatum: 09.06.14 Neueste Beiträge
Thanks Meera Prince and Tejas Kanani!
@Tejas Kanani: your link is very helpful for me. But i still have one problem with "small image". I did not know how to show "small image". Can you show me how to do it?
robin thakur, geändert vor 9 Jahren.

RE: how to create portlet show articles

Regular Member Beiträge: 146 Beitrittsdatum: 09.01.14 Neueste Beiträge
Hi,

Somebody help me to create Press release or newsroom page for my liferay portal. Explain with demo please


thanks
thumbnail
Tejas Kanani, geändert vor 9 Jahren.

RE: how to create portlet show articles

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
I did not know how to show "small image".

Well ! Here are you looking for a way to determine the size of Image ? If yes, you can easily manage it using css by providing the height and width of an image.
Huy Nguyen, geändert vor 9 Jahren.

RE: how to create portlet show articles

New Member Beiträge: 3 Beitrittsdatum: 09.06.14 Neueste Beiträge
Thanks Tejas Kanani!
Your help is very helpful with me. In my case, I worked with following code to show "small image".
<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] />

<#list entries as entry>
<#assign assetRenderer = entry.getAssetRenderer() />
<#assign className = entry.getClassName() >
<#if className == "com.liferay.portlet.journal.model.JournalArticle">
<#assign article = assetRenderer.getArticle() >
<#assign img = article.getSmallImageId() >
<img src="/image/image_gallery?img_id=${img}" width="379" height="250" alt="" />
</#if>
</#list>
</div>
thumbnail
Tejas Kanani, geändert vor 9 Jahren.

RE: how to create portlet show articles

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
Glad to know it helped. And thanks for sharing the code. It will help other community members who are looking for the same.

-Tejas