Jump to content

Topic Block with Forum and First Post Content


AlexWebsites

Recommended Posts

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}}

 

Link to comment
Share on other sites

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}}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...