Moving lastest post date to category banner
Hello everyone,
This is what I am trying to do on the category tabs:
- Category Title
- Post Counts
- Post_date (just one from the latest posts from any of the boards)
This is what I have so far with the title and counts working except the date:
<--!
<#assign categories = rest("/categories").categories />
<#assign threadCount = (rest(category.@href + "/topics/count").value)?number />
<#assign postTime = (rest(category.@href + "/messages/post_time").value)/>
Thank you in advance I appreciate it any direction or help on this topic.
-->
You can use context object to get the category title on the category page. Context object will give the error in the component but works fine on community pages i.e. Category page, board page etc.
Here is the code to get the title and threads count on the category page you are visiting
<#assign title = ${coreNode.id} /> <#assign threadCount = (rest(/categories/id/${coreNode.id}/topics/count").value)?number />
V1 API does not allow to fetch the partial info. I mean you can not get only post_time from the message, it would return the whole message content.
For this one, you have to use the V2 API
select post_time from messages where category.id="${coreNode.id}" order by post_time desc