Forum Discussion
VarunGrazitti
10 years agoBoss
vishwajeet_hol - You mean the ID of the article? if yes, it would be same as for the other topics.
More details here - https://community.lithium.com/t5/Developers-Knowledge-Base/FreeMarker-context-objects-and-directives/ta-p/9217
and
here, https://community.lithium.com/t5/Developers-Knowledge-Base/page-FreeMarker-context-object/ta-p/9331
More details here - https://community.lithium.com/t5/Developers-Knowledge-Base/FreeMarker-context-objects-and-directives/ta-p/9217
and
here, https://community.lithium.com/t5/Developers-Knowledge-Base/page-FreeMarker-context-object/ta-p/9331
vishwajeet_hol
10 years agoExpert
I want the teaser image of blog article.
For this i am using this rest api call :
<#assign blog_article_teaser = restadmin("/messages/id/<blog_article_ID>/teaser?restapi.response_style=view").value />
I used below context object for blog_article_ID, but its of no use. :
- ${page.context.message.id}
- ${env.context.message.id}
- ${message.id}
- ${message.uniqueId}
- ${page.context.message.uniqueId}
- ${env.context.message.uniqueId}
Let me know if you have any idea.
Thank you.
Regards,
Vishwajeet.
- vishwajeet_hol10 years agoExpert
Hi,
Just for your information.
I have done that using freemrker.
<#assign pageurl=http.request.url/> <#assign pathparams=pageurl?split("/")/> <#assign blog_ID = pathparams[(pathparams?size)-1]/> <#assign blog_article_teaser = restadmin("/messages/id/${blog_ID}/teaser?restapi.response_style=view").value />
Let me know if we can do the same using freemarker context object
Thank you.
Regards,
Vishwajeet
- ttadej7 years agoAdvisor
"Teaser" refers to a text preview. You might be trying to get the "cover image".. in that case try this API v2 call
<#assign blogId = (page.context.message.uniqueId)! /> <#-- Then the v2 call is something like SELECT cover_image from messages WHERE id = '${blogId!}' -->
Related Content
- 12 years ago
- 4 years ago
- 4 years ago
- 13 years agoInactive User