How to exclude specific forum from Recent Activity?

MikeMpls

Well-known member
I need to exclude a specific forum from the "What's New?" and "Recent Activity".

Excluding it from "What's New?" was easy given that that is well documented already.

Excluding it from the "Recent Activity" is proving to be more difficult. Ideally this would be done at a higher level, e.g. in the "news_feed" template (lines 8 & 13) :

Code:
<xen:require css="events.css" />
<xen:require css="news_feed.css" />
<xen:require js="js/xenforo/news_feed.js" />

<xen:if is="{$newsFeed}">
    <ol class="eventList">
        <xen:foreach loop="$newsFeed" value="$item">
                    <xen:if is="({$item.WHATDOITESTFORHERE} != 'Name of Forum to Exclude')">
            <xen:include template="news_feed_item">
                <xen:set var="$itemTemplate">{xen:raw $item.template}</xen:set>
                <xen:set var="$itemDate">{$item.event_date}</xen:set>
            </xen:include>
                    </xen:if>
        </xen:foreach>
    </ol>
<xen:else />
    {xen:raw $noContentHtml}
</xen:if>

I can't figure out anything for "WHATDOITESTFORHERE" that will work.

At a lower level (when inserting new thread items in the feed) I can check the value of {$content.node_title}. That gets rid of the thread but leaves the avatar. I can't figure out any way to get rid of the avatar & any responses to the thread, not to mention the "likes" that might inevitably appear.
 
Keep in mind that the approach you are taking is a very hackish solution that will probably have side effects similar to this.

Having said that, I think you want this code for the news_feed template:

Code:
<xen:require css="events.css" />
<xen:require css="news_feed.css" />
<xen:require js="js/xenforo/news_feed.js" />

<xen:if is="{$newsFeed}">
	<ol class="eventList">
		<xen:foreach loop="$newsFeed" value="$item">
			<xen:if is="{$item.content.node_id} != 4">
				<xen:include template="news_feed_item">
					<xen:set var="$itemTemplate">{xen:raw $item.template}</xen:set>
					<xen:set var="$itemDate">{$item.event_date}</xen:set>
				</xen:include>
			</xen:if>
		</xen:foreach>
	</ol>
<xen:else />
	{xen:raw $noContentHtml}
</xen:if>
 
That got rid of the news feed item for a thread (& the icon associated with that item, so that was a slight improvement), but it does not get rid of news feed items for posts that are in response to a thread. Neither the thread title nor the node ID appear to be set -- or to be stored differently -- for replies to a thread in a news feed.
 
Top Bottom