XF 2.2 Block usergroup from latest activity

Edit the latest_activity template and wrap the content in a conditional statement:

HTML:
<xf:if is="!$xf.visitor.isMemberOf(x)">
    Content
</xf:if>

Replace x with the user group ID.
 
  • Like
Reactions: WxP
You should clarify exactly what you mean when making requests of this nature.

Use this to prevent guests seeing content: <xf:if is="!$xf.visitor.user_id">
 
Sorry, i have created an user group permission (part of guest) and this user group need to be limited on latest activity, exactly not allowed to view latest_activity

But i just see reply x Thank you
 
Edit the latest_activity template and wrap the content in a conditional statement:

HTML:
<xf:if is="!$xf.visitor.isMemberOf(x)">
    Content
</xf:if>

Replace x with the user group ID.
i try this but it don`t have effect

can you please give me exactly where do i put i have trying tthis:
<xf:title>{{ phrase('latest_activity') }}</xf:title> <xf:wrap template="whats_new_wrapper"> <xf:set var="$pageSelected" value="latest_activity" /> </xf:wrap> <div class="block"> <div class="block-container"> <xf:if is="$xf.visitor.canViewProfilePosts()"> <ul class="block-body js-newsFeedTarget"> <xf:foreach loop="$newsFeedItems" value="$item"> <xf:macro template="news_feed_macros" name="feed_row" arg-item="{$item}" /> </xf:foreach> </ul> <div class="block-footer js-newsFeedLoadMore"> <span class="block-footer-controls"><xf:button href="{{ link('whats-new/latest-activity', null, {'before_id': $oldestItemId}) }}" rel="nofollow" data-xf-click="inserter" data-append=".js-newsFeedTarget" data-replace=".js-newsFeedLoadMore"> {{ phrase('show_older_items') }} </xf:button></span> </div> <xf:if is="!$xf.visitor.isMemberOf(14)"> Content </xf:if> <xf:elseif is="$beforeId" /> <div class="block-body js-newsFeedTarget"> <div class="block-row block-row--separated">{{ phrase('there_no_more_items_to_show') }}</div> </div> <xf:else /> <div class="block-body js-newsFeedTarget"> <div class="block-row">{{ phrase('news_feed_is_currently_empty') }}</div> </div> </xf:if> </div> </div>
 
It's really not clear what you are trying to do.

Are you trying to a prevent a specific user group from viewing latest activity, or guests?

The two are mutually exclusive.
 
Top Bottom