XF 2.2 default to showing "About" when first viewing a profile?

zoldos

Well-known member
I've added quite a few custom fields for my member's profiles. But I want to have "About" be the default tab when viewing a profile. I took a look at the code and even tried a few things, but couldn't get it to work.

Any help would be most appreciated! Thanks!
 
Edit template: member_view

Find:
PHP:
<xf:if is="$user.canViewPostsOnProfile()">
                    <a href="{{ link('members', $user) }}"
                        class="tabs-tab is-active"
                        role="tab"
                        aria-controls="profile-posts">{{ phrase('profile_posts') }}</a>
                </xf:if>
Replace with:
PHP:
<xf:if is="$user.canViewPostsOnProfile()">
                    <a href="{{ link('members', $user) }}"
                        class="tabs-tab"
                        role="tab"
                        aria-controls="profile-posts">{{ phrase('profile_posts') }}</a>
                </xf:if>

Find:
PHP:
<a href="{{ link('members/about', $user) }}"
                    class="tabs-tab"
                    id="about"
                    role="tab">{{ phrase('about') }}</a>
Replace with:
PHP:
<a href="{{ link('members/about', $user) }}"
                    class="tabs-tab is-active"
                    id="about"
                    role="tab">{{ phrase('about') }}</a>
 
Edit template: member_view

Find:
PHP:
<xf:if is="$user.canViewPostsOnProfile()">
                    <a href="{{ link('members', $user) }}"
                        class="tabs-tab is-active"
                        role="tab"
                        aria-controls="profile-posts">{{ phrase('profile_posts') }}</a>
                </xf:if>
Replace with:
PHP:
<xf:if is="$user.canViewPostsOnProfile()">
                    <a href="{{ link('members', $user) }}"
                        class="tabs-tab"
                        role="tab"
                        aria-controls="profile-posts">{{ phrase('profile_posts') }}</a>
                </xf:if>

Find:
PHP:
<a href="{{ link('members/about', $user) }}"
                    class="tabs-tab"
                    id="about"
                    role="tab">{{ phrase('about') }}</a>
Replace with:
PHP:
<a href="{{ link('members/about', $user) }}"
                    class="tabs-tab is-active"
                    id="about"
                    role="tab">{{ phrase('about') }}</a>
Worked perfectly. Thanks so much!!
 
I just uploaded the add-on. Works a charm. I like it, and it makes sense to default to the "About" tab.
Chuck Norris Qt GIF
 
Back
Top Bottom