ContributionsMost RecentMost LikesSolutionsRe: I keep getting a message saying 'This widget could not be displayed.' I have finally got to the bottom of this issue. It turns out that it wasnt the attempt recover block which was causing the problem it was indeed a permissions issues as Adam mentioned in an earlier post. If you do a rest call and you do not have the correct permissions the message 'This widget could not be displayed.' is shown, even if you are not currently using the responce from the rest call. If you get this message and you are not sure why, check all of your API calls using in a browser and you might find a message similar to this User -1 does not have the following permission(s) at XYZ: [ read_board ] I had to ensure that all my users had a role with the 'see boards' permission set. This can be done in admin -> users -> roles Re: This widget could not be displayed I had the same issue here and never did get to the bottom of it. Frustratingly im getting the same problem again while using an if/else block on another section of code. Any update on this would be very helpful Re: how do i truncate an article body I found the answer here http://lithosphere.lithium.com/t5/support-knowledge-base/Character-truncation-variables/ta-p/38324 and used the following which worked perfectly. ${utils.html.truncate(10,variable_name, "...")} Re: how do i truncate an article bodyIs this even possible using Lithium? If not I will search for another solutionhow do i truncate an article body I would like to truncate the text in the body of a blog article. I have used the freemarker substring function to do this however if any styling is added to the blog body text the closing tags are lost and the page looks broken. Is there any way to truncate this text without losing the formatting? SolvedRe: I keep getting a message saying 'This widget could not be displayed.'Hi Doug, No there was nothing else in there. During testing I stripped the recover block down to just a failing API call or assign command (to trigger the recover section of the attempt/recover block) and just added in some text in the recover block to say that it had failed. I got the same 'this widget could not be displayed'. I used #assign to create several different ways which would cause an error each one appears to work when i am testing in studio and when i am logged in as admin but show that error message when i am not logged in. Replace the attempt/recover with a if statement with the same API calls and #assign block and everything works fine.Re: I keep getting a message saying 'This widget could not be displayed.'Hi Adam, Doug, I have now removed all of my attempt/recover blocks and replaced them with if statements. I have used all of the same rest calls and no longer get the issue. Seems strange to me. Thanks NIckRe: sorting forum posts by the number of messages in each post Hi Yuri, Now ive added some more activity to my board ive noticed that the ordering isnt quite right. My top 5 boards are ordered by the number of messages as shown descibed in your code above however it is ordered as described below 5 3 11 1 1 I believe this is because the sort_by is assuming that the content of the count field is text. In a previous thread (https://lithosphere.lithium.com/t5/developers-discussion/sorting-forum-posts-by-the-number-of-messages-in-each-post/m-p/83626#M2959) i added in the ?number command however when i do the same here it throws an error. Thanks Nick Re: sorting forum posts by the number of messages in each post Hi Yuri, That was exactly what i was after, i did make one small change, i added in ?number after /messages/count").value as it was treating the numbers as text and was putting the boards in a slightly wrong order. <#assign boards = rest("categories/id/5678/boards").boards/> <#assign order_list = []/> <#list boards.board as c> <#assign one_index_obj = {"count":rest("/boards/id/${c.id}/messages/count").value?number, "spot":c_index}/> <#assign order_list = order_list + [one_index_obj]/> </#list> <#list order_list?sort_by("count")?reverse as list_item> ${list_item.count}:${list_item.spot}<p> ${boards.board[list_item.spot].title}<p> </#list> Thanks Yuri, this has been a massive help Re: sorting forum posts by the number of messages in each post Hi Yuri, Thanks for your response, My problem is that i want to order these by the number of messages on each board. As i understand it you need to order at the level of the list by adding ?sort_by <#list boards.category.boards.board as c> however at this point i do not know the number of messages in each board so i am not able to order them. Thanks Nick