Foren
Get Small Image from Blog Entry using Freemarker.
Claudio Donaté, geändert vor 9 Jahren.
Get Small Image from Blog Entry using Freemarker.
Junior Member Beiträge: 68 Beitrittsdatum: 09.04.15 Neueste Beiträge
Hello guys. I'm very new to Liferay and I need some help. I have a Asset Publisher on my home page and I need to display a few Blog entries with my own Display template.
The information I need to show are the same ones that show when I choose Abstract. Title, Abstract, Small Image and a link to read the full blog entry on another page.
The title, abstract and link (sort of) I know how to do it, it's just the Small Image that I can't seem to find. I know how to do it on a Article, but not on a blog entry.
Can anyone help me? If there is a simple way to make the link, I would also like to know.
Any help is appreciated.
Thanks.
I'm using Liferay 6.2 ga2 with Tomcat 7.
Cheers.
The information I need to show are the same ones that show when I choose Abstract. Title, Abstract, Small Image and a link to read the full blog entry on another page.
The title, abstract and link (sort of) I know how to do it, it's just the Small Image that I can't seem to find. I know how to do it on a Article, but not on a blog entry.
Can anyone help me? If there is a simple way to make the link, I would also like to know.
Any help is appreciated.
Thanks.
I'm using Liferay 6.2 ga2 with Tomcat 7.
Cheers.
Claudio Donaté, geändert vor 9 Jahren.
RE: Get Small Image from Blog Entry using Freemarker.
Junior Member Beiträge: 68 Beitrittsdatum: 09.04.15 Neueste Beiträge
Anybody? Please, help.
Jan Geißler, geändert vor 9 Jahren.
RE: Get Small Image from Blog Entry using Freemarker.
Liferay Master Beiträge: 735 Beitrittsdatum: 05.07.11 Neueste Beiträge
Hey, maybe:
blogsEntry.getSmallImageURL()
could give you the wanted result.
Not sure about it, as i haven't tried this out, but it SHOULD work ;)
blogsEntry.getSmallImageURL()
could give you the wanted result.
Not sure about it, as i haven't tried this out, but it SHOULD work ;)
Sebastian Wörner, geändert vor 8 Jahren.
RE: Get Small Image from Blog Entry using Freemarker.
Junior Member Beiträge: 46 Beitrittsdatum: 18.11.14 Neueste Beiträge
In my Display Templates for the Asset Publisher, i use this code to show the thumbnails:
<#if entries?has_content>
<#list entries as entry>
...
<img src="${entry.getAssetRenderer().getThumbnailPath(renderRequest)}">
...
<!--#list-->
<!--#if-->
Matteo Gnocchi, geändert vor 7 Jahren.
RE: Get Small Image from Blog Entry using Freemarker.
Junior Member Beiträge: 29 Beitrittsdatum: 29.03.16 Neueste Beiträge
Hi!!!
I'm trying to do the same on Liferay 7 CE but I get the following error:
The following has evaluated to null or missing:
==> curEntry.getAssetRenderer().getThumbnailPath(renderRequest)
Can you help me?
Thx!!!
I'm trying to do the same on Liferay 7 CE but I get the following error:
The following has evaluated to null or missing:
==> curEntry.getAssetRenderer().getThumbnailPath(renderRequest)
Can you help me?
Thx!!!
Sebastian Wörner:
In my Display Templates for the Asset Publisher, i use this code to show the thumbnails:<#if entries?has_content> <#list entries as entry> ... <img src="${entry.getAssetRenderer().getThumbnailPath(renderRequest)}"> ... <!--#list--> <!--#if-->
Marek Cz, geändert vor 6 Jahren.
RE: Get Small Image from Blog Entry using Freemarker.
Junior Member Beiträge: 47 Beitrittsdatum: 17.11.17 Neueste Beiträge
Hey,
in case someone still runs into this:
The problem on my end was that some articles had a thumbnail while others did not. I resolved it using the following:
Hope this helps.
in case someone still runs into this:
Matteo Gnocchi:
Hi!!!
I'm trying to do the same on Liferay 7 CE but I get the following error:
The following has evaluated to null or missing:
==> curEntry.getAssetRenderer().getThumbnailPath(renderRequest)
The problem on my end was that some articles had a thumbnail while others did not. I resolved it using the following:
<#if entry.getClassName() == "com.liferay.journal.model.JournalArticle" && assetRenderer.getThumbnailPath(renderRequest)??>
<p>My thumbnail image: <img src="${assetRenderer.getThumbnailPath(renderRequest)}"></p>
<!--#if-->
Hope this helps.