• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 how to hide "Forum Tab" and "New Posts"

erich37

Well-known member
#1
I have set all my Forums to "Private" for guests.
So only registered members will see the Forums.

Now I would like to hide the "Forums Tab" and the "New Posts"-Tab (in the SubNavBar) from guests.


Could you please let me know how in which template I can hide these Tabs ?



I do not want to hide it with
Code:
display: none !important;



.... but I want to hide it with
Code:
<xen:if is="{$visitor.user_id}">


Appreciate your help!


:)
 

erich37

Well-known member
#3
Many thanks Jake!

Got it.



Code:
<!-- forums -->
        <xen:if is="{$tabs.forums}">
            <li class="navTab forums {xen:if $tabs.forums.selected, 'selected', 'Popup PopupControl PopupClosed'}">
            <xen:if is="{$visitor.user_id}">
                <a href="{$tabs.forums.href}" class="navLink">{$tabs.forums.title}</a>
                <a href="{$tabs.forums.href}" class="SplitCtrl" rel="Menu"></a>
               
                <div class="{xen:if {$tabs.forums.selected}, 'tabLinks', 'Menu JsOnly tabMenu'} forumsTabLinks">
                    <div class="primaryContent menuHeader">
                        <h3>{$tabs.forums.title}</h3>
                        <div class="muted">{xen:phrase quick_links}</div>
                    </div>
                    <ul class="secondaryContent blockLinksList">
                    <xen:hook name="navigation_tabs_forums">
                        <xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'forums/-/mark-read', $forum, 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_forums_read}</a></li></xen:if>
                        <xen:if is="{$canSearch}"><li><a href="{xen:link search, '', 'type=post'}">{xen:phrase search_forums}</a></li></xen:if>
                        <xen:if is="{$visitor.user_id}">
                            <li><a href="{xen:link 'watched/forums'}">{xen:phrase watched_forums}</a></li>
                            <li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li>
                        </xen:if>
                        <li><a href="{xen:link 'find-new/posts'}" rel="nofollow">{xen:if $visitor.user_id, {xen:phrase new_posts}, {xen:phrase recent_posts}}</a></li>
                    </xen:hook>
                    </ul>
                </div>
                <xen:else/>                               
                <div class="tabLinks"></div>
            </xen:if>
            </li>
        </xen:if>
 
Last edited:
#4
Now I would like to hide the "Forums Tab" and the "New Posts"-Tab (in the SubNavBar) from guests.

I do not want to hide it with
Code:
display: none !important;
.... but I want to hide it with
Code:
<xen:if is="{$visitor.user_id}">
What part of the code would I use and where exactly do I insert it in the navigation template?