Using REST and Freemarker to Build Components. “let’s make something”. “I want to show the most recent blog article and when it was posted”. Ok, no problem. First get the message from REST. /topics/style/blog/ recent?page\_size =1 And assign that to a freemarker variable
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
“let’s make something”
Ok, no problem. First get the message from REST.
And assign that to a freemarker variable
<#assign recent= rest(“/topics/style/blog/recent?page_size=1”).messages />
Still no problem. We’ll just change our REST call to be specific to one board.
<#assign recent = rest(“/boards/id/bloggy/topics/recent?page_size=1”).messages />
If you want to see your pure xml response in the browser you need to have “restapi/vc” in the url. If you are making the call in Freemarker, we take care of that part for you.
Is the same as this:
<#assign myCall = rest(“/boards/id/lithiumblog/topics/recent?page_size=1”) />
Welcome to Bloggy2013-11-18T17:34:08+00:00
Good point, you can get more user friendly info by adding a parameter to your rest call
This changes the response for post time from this:
We used @view_friendly_date without ever checking that it existed.