Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
AlexWebsites Posted February 26, 2017 Posted February 26, 2017 In pages, I am trying to create a simple block to show the latest topics, the forum it's from, and truncated first post content of that topic. I need to add the forum and truncated first post text. I'm using the following to start with. I'm still looking through the templates but if anyone knows off the top of their head, appreciate the help. {{if !empty( $topics ) }} <h3 class='ipsWidget_title ipsType_reset'>{$title}</h3> <div class='ipsPad_half ipsWidget_inner'> <ul class='ipsDataList ipsDataList_reducedSpacing'> {{foreach $topics as $topic}} <li class='ipsDataItem{{if $topic->unread()}} ipsDataItem_unread{{endif}}{{if $topic->hidden()}} ipsModerated{{endif}}'> <div class='ipsDataItem_main cWidgetComments'> <div class='ipsType_break ipsContained'> <a href="{$topic->url()->setQueryString( 'do', 'getNewComment' )}" title='{lang="view_this_topic" sprintf="$topic->title"}' class='ipsDataItem_title'>{$topic->title}</a> </div> </div> </li> {{endforeach}} </ul> </div> {{endif}}
AlexWebsites Posted February 26, 2017 Author Posted February 26, 2017 I figured out what I needed. I had to look at some of the templates in order to figure out some of the logic. {{if !empty( $topics ) }} <h3 class='ipsWidget_title ipsType_reset'>{$title}</h3> <div class='ipsPad_half ipsWidget_inner'> <ul class='ipsDataList ipsDataList_reducedSpacing'> {{foreach $topics as $topic}} <li class='ipsDataItem{{if $topic->unread()}} ipsDataItem_unread{{endif}}{{if $topic->hidden()}} ipsModerated{{endif}}'> <div class='ipsDataItem_main cWidgetComments'> <div class='ipsType_break ipsContained'> <a href="{$topic->url()->setQueryString( 'do', 'getNewComment' )}" title='{lang="view_this_topic" sprintf="$topic->title"}' class='ipsDataItem_title'>{$topic->title}</a> <br><a href="{$topic->container()->url()}">{$topic->container()->_title}</a> <div class='ipsType_medium ipsType_textBlock ipsType_richText ipsType_break ipsContained ipsSpacer_top ipsSpacer_half' data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='2 lines' data-ipsTruncate-watch='false'> {$topic->truncated( true )|raw} <div> </div> </div> {{endforeach}}</ul></div> {{endif}}
Recommended Posts
Archived
This topic is now archived and is closed to further replies.