In a typical thread view page, there are thread indicators to show whether the thread is locked, sticky, featured, followed, etc. This also appears on some, but not all, of the "New" listings--they show up on What's New (Newest Threads, Latest Posts, New Posts) but not on the Latest Activity page.
In the search result listing, these indicators do not show up either.
Is the data exposed to search results so I can add them into my style?
I found the related code in the template
Plus, I would need to know if this data is exposed before I try it.
The macro in question is
In the search result listing, these indicators do not show up either.
Is the data exposed to search results so I can add them into my style?
I found the related code in the template
thread_list_macros but don't know how much of it could be adapted to where I need it to go--could I just include the macro, or do I need to extract only what I need? I don't quite know how those macros work.Plus, I would need to know if this data is exposed before I try it.
The macro in question is
<xf:macro id="item" ... where the code is located. It is encapsulated in <ul> within that macro. Here is the excerpt.
HTML:
<ul class="structItem-statuses">
<xf:contentcheck>
<xf:extension id="statuses">
<xf:if is="property('reactionSummaryOnLists') == 'status' && $thread.first_post_reactions">
<li><xf:reactions summary="true" reactions="{$thread.first_post_reactions}" /></li>
</xf:if>
<xf:extension id="before_status_state"></xf:extension>
<xf:if is="$thread.discussion_state == 'moderated'">
<li>
<xf:set var="$moderatedStatus">
<i class="structItem-status structItem-status--moderated" aria-hidden="true" title="{{ phrase('awaiting_approval')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('awaiting_approval') }}</span>
</xf:set>
<xf:if is="$thread.canCleanSpam()">
<a href="{{ link('spam-cleaner', $thread) }}" data-xf-click="overlay">{$moderatedStatus}</a>
<xf:else />
{$moderatedStatus}
</xf:if>
</li>
</xf:if>
<xf:if is="$thread.discussion_state == 'deleted'">
<li>
<i class="structItem-status structItem-status--deleted" aria-hidden="true" title="{{ phrase('deleted')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('deleted') }}</span>
</li>
</xf:if>
<xf:if is="!$thread.discussion_open">
<li>
<i class="structItem-status structItem-status--locked" aria-hidden="true" title="{{ phrase('locked')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('locked') }}</span>
</li>
</xf:if>
<xf:extension id="status_sticky">
<xf:if is="$thread.sticky">
<li>
<i class="structItem-status structItem-status--sticky" aria-hidden="true" title="{{ phrase('sticky')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('sticky') }}</span>
</li>
</xf:if>
</xf:extension>
<xf:extension id="status_featured">
<xf:if is="$thread.featured">
<li>
<i class="structItem-status structItem-status--featured" aria-hidden="true" title="{{ phrase('featured')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('featured') }}</span>
</li>
</xf:if>
</xf:extension>
<xf:extension id="before_status_watch"></xf:extension>
<xf:if is="{$showWatched} AND {$xf.visitor.user_id}">
<xf:if is="{$thread.Watch.{$xf.visitor.user_id}}">
<li>
<i class="structItem-status structItem-status--watched" aria-hidden="true" title="{{ phrase('thread_watched')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('thread_watched') }}</span>
</li>
<xf:elseif is="!$forum AND {$thread.Forum.Watch.{$xf.visitor.user_id}}" />
<li>
<i class="structItem-status structItem-status--watched" aria-hidden="true" title="{{ phrase('forum_watched')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('forum_watched') }}</span>
</li>
</xf:if>
</xf:if>
<xf:extension id="before_status_type"></xf:extension>
<xf:if is="$thread.discussion_type == 'redirect'">
<xf:extension id="thread_type_redirect">
<li>
<i class="structItem-status structItem-status--redirect" aria-hidden="true" title="{{ phrase('redirect')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('redirect') }}</span>
</li>
</xf:extension>
<xf:elseif is="$thread.discussion_type == 'question' && $thread.type_data.solution_post_id" />
<xf:extension id="thread_type_question_solved">
<li>
<i class="structItem-status structItem-status--solved" aria-hidden="true" title="{{ phrase('solved')|for_attr }}"></i>
<span class="u-srOnly">{{ phrase('solved') }}</span>
</li>
</xf:extension>
<xf:elseif is="!$forum || $forum.forum_type_id == 'discussion'" />
<xf:extension id="thread_type_icon">
<xf:if is="$thread.discussion_type != 'discussion'">
<xf:set var="$threadTypeHandler" value="{{ $thread.getTypeHandler() }}" />
<xf:if is="$threadTypeHandler.getTypeIconClass()">
<li>
<xf:set var="$threadTypePhrase" value="{{ $threadTypeHandler.getTypeTitle() }}" />
<xf:fa class="structItem-status" icon="{{ $threadTypeHandler.getTypeIconClass() }}" title="{$threadTypePhrase|for_attr}" />
<span class="u-srOnly">{$threadTypePhrase}</span>
</li>
</xf:if>
</xf:if>
</xf:extension>
</xf:if>
</xf:extension>
</xf:contentcheck>
</ul>