Forum Discussion
luk
11 months agoBoss
HariniVuppala suggestion is one way to achieve this, but maybe you want some more control over the output and/or you are not interested in displaying the original post date but only want the last edit date etc., so another option that I'm using sometimes for stuff like this is to @override the OOB post_date component which is commonly used to display dates. As this component is used not only for TKB's but for other content types as well, you'd have to scope it to only do that when it's used to display on a TKB Article which you would do with something like this:
<#if page.interactionStyle == 'tkb' && page.name == 'TkbArticlePage'>
<#assign query = "SELECT current_revision.last_edit_time FROM messages WHERE id = '${page.context.thread.topicMessage.id}'" />
<#assign res = (liql(query).data.items[0])!{} />
<#-- You might wanna transform that ISO date to something more readable when displaying it, freemarker has some built ins for that purpose -->
<time datetime="${res.current_revision.last_edit_time}">${res.current_revision.last_edit_time}</time>
<#else>
<@delegate /> <#-- displays original component content -->
</#if>
Related Content
- 2 years ago
- 7 months ago
- 2 years ago