Forum Discussion

skylinegtr's avatar
10 years ago

Forum Thread Layout

Hello!   I was checking out this site: http://community.k2.com/ and I really like the thread layout shown below.  I would like to do something like this. Any tips on how I can create something like...
  • mahesh_revanwar's avatar
    mahesh_revanwar
    10 years ago

    Hi skylinegtr,

     

    Try this

    <#assign messageList = rest("/categories/id/mahesh_revanwar/search/messages?q=is_root:true&sort_by=-views&restapi.response_style=view").messages.message />
    
    <#list messageList as msg >
    	<a href="${msg.@view_href}">${msg.subject}</a>
    	<br>
    	<#assign avatar = rest("${msg.author.@href}/profiles/avatar").image.url>
    	Avatar: <img src="${avatar}">
    	Author : ${msg.author.login}
    	<br>
    	Date : ${msg.post_time.@view_date} | ${msg.post_time.@view_time}
    	<br>
    	Views : ${msg.views.count}
    	<br>
    	<br>
    </#list>

    Regards,

    Mahesh Revanwar

     

    If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."

  • vishwajit_shind's avatar
    vishwajit_shind
    10 years ago

    Hi skylinegtr,

     

    You need to change variable name which is correct, as if you consider example provided by mahesh_revanwer the looping is done with "msg" variable used. Considering this variable you can write a code as follows:-

    <#assign replyCount = rest("${msg.thread.@href}/replies/count").value>
    ${replyCount}

    As the "topic" variable is not present in your code error got generated.

     

    Regards,

    Vishwajit Shinde

     

    If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."