XF 2.3 How to get the Current Visitors page to default to the Members tab?

Solution
So in: widget_members_online
Change this:
Code:
 <h3 class="block-minorHeader"><a href="{{ link('online') }}">{$title}</a></h3>
to this:
Code:
<h3 class="block-minorHeader"><a href="{{ link('online/?type=member') }}">{$title}</a></h3>
Should do it in a template modification. And not direct.
Use this under the nav for Members:
Code:
{{ link('members/list') }}
Then disable Registered members in the nav since it is the samething.

EDIT: Read it to fast. You were asking for a different place. haha

EDIT Agian: Under nav >members> Current visitors. Change the link too:
Code:
{{ link('online/?type=member') }}
 
Last edited:
It's the widget title, you know, the one that displays the list of online users. It clicks to that page.

Less:
<xf:if is="$options.staffOnline">
    <xf:if contentcheck="true">
        <div class="block" data-widget-section="staffMembers"{{ widget_data($widget) }}>
            <div class="block-container">
                <h3 class="block-minorHeader"><a href="{{ link('members', null, {'key': 'staff_members'}) }}">{{ phrase('staff_online') }}</a></h3>
                <ul class="block-body">
                <xf:contentcheck>
                    <xf:foreach loop="$online.users" value="$user">
                        <xf:if is="$user.is_staff">
                            <li class="block-row">
                                <div class="contentRow">
                                    <div class="contentRow-figure">
                                        <xf:avatar user="$user" size="xs" />
                                    </div>
                                    <div class="contentRow-main contentRow-main--close">
                                        <xf:username user="$user" rich="true" />
                                        <div class="contentRow-minor">
                                            <xf:usertitle user="$user" />
                                        </div>
                                    </div>
                                </div>
                            </li>
                        </xf:if>
                    </xf:foreach>
                </xf:contentcheck>
                </ul>
            </div>
        </div>
    </xf:if>
</xf:if>

<div class="block" data-widget-section="onlineNow"{{ widget_data($widget) }}>
    <div class="block-container">
        <h3 class="block-minorHeader"><a href="{{ link('online') }}">{$title}</a></h3>
        <div class="block-body">
            <xf:if contentcheck="true">
                <div class="block-row block-row--minor">
                    <h4 class="block-textHeader block-textHeader--scaled">
                        {{ phrase('people_you_follow') }}
                    </h4>
                    <ul class="listHeap">
                        <xf:contentcheck>
                            <xf:if is="$options.followedOnline">
                                <xf:foreach loop="$online.users" value="$user">
                                    <xf:if is="in_array($user.user_id, $xf.visitor.Profile.following)">
                                        <li>
                                            <xf:avatar user="$user" size="xxs" img="true" />
                                        </li>
                                    </xf:if>
                                </xf:foreach>
                            </xf:if>
                        </xf:contentcheck>
                    </ul>
                </div>

                <div class="block-row block-row--minor">
                    <h4 class="block-textHeader block-textHeader--scaled">
                        {{ phrase('members') }}
                    </h4>
            <xf:else />
                <div class="block-row block-row--minor">
            </xf:if>

                <xf:if is="$online.users is not empty">
                    <ul class="listInline listInline--comma">
                        <xf:foreach loop="$online.users" value="$user"><xf:trim>
                            <li><xf:username user="$user" rich="true" class="{{ !$user.visible ? 'username--invisible' : '' }}" /></li>
                        </xf:trim></xf:foreach>
                    </ul>
                    <xf:if is="$online.counts.unseen">
                        <a href="{{ link('online') }}">{{ phrase('ellipsis_and_x_more', {'count': $online.counts.unseen}) }}</a>
                    </xf:if>
                <xf:else />
                    {{ phrase('no_members_online_now') }}
                </xf:if>
            </div>
        </div>
        <div class="block-footer">
            <span class="block-footer-counter">{{ phrase('online_now_x_members_y_guests_z',{
                'total': number($online.counts.total),
                'members': number($online.counts.members),
                'guests': number($online.counts.guests)})
            }}</span>
        </div>
    </div>
</div>
/CODE]
 
Last edited:
So in: widget_members_online
Change this:
Code:
 <h3 class="block-minorHeader"><a href="{{ link('online') }}">{$title}</a></h3>
to this:
Code:
<h3 class="block-minorHeader"><a href="{{ link('online/?type=member') }}">{$title}</a></h3>
Should do it in a template modification. And not direct.
 
Solution
Works, thanks!

Well, not sure what that means but I did it in acp where templates are edited.
Just means if an update comes out and it hits the widget_members_online and changes it, you will not have your edit anymore. Template modifications prevent from happening. If I have time, I will do a quick addon for it. I also did a HTML widget for it and a widget addon for it. Have a look.
HTML widget: Just a box with the link.
1761424168905.webp
Addon widget: Shows avatar and username. One setting to choose how many you want to display.
1761424198521.webp

And welcome!
 
I'm actually fine with template edits, have plenty of them, the merge tool works 99% of the time. Thanks for the help! If you create the add-on I will have a look but I might actually prefer the minor edit in this case.
 
Back
Top Bottom