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

Add-on Add 'Your Posts' and 'Your Threads' to Navigation Bar

Discussion in 'Resource and Add-on Requests' started by Amin Sabet, Feb 24, 2015.

  1. Amin Sabet

    Amin Sabet Well-Known Member

    I am looking for an addon that would include "Your Posts" and "Your Threads" in the navigation bar for logged in users.

    2015-02-24_0716.png
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Edit the navigation template.
    Add the code in orange.

    Code:
    <!-- forums -->
    <xen:if is="{$tabs.forums}">
        <li class="navTab forums {xen:if $tabs.forums.selected, 'selected', 'Popup PopupControl PopupClosed'}">
      
            <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:if is="{$visitor.user_id}">
                        <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}">{xen:phrase your_threads}</a></li>
                        <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=post'}">{xen:phrase your_posts}</a></li>
                    </xen:if>
                </xen:hook>
                </ul>
            </div>
        </li>
    </xen:if>
     
    accyroy likes this.
  3. Amin Sabet

    Amin Sabet Well-Known Member

    Thanks, Brogan!
     
  4. Amin Sabet

    Amin Sabet Well-Known Member

    Based on that, I figured out how to add to the CTA Featured page as well. In case anyone else is wondering:

    Edit the cta_featuredthreads_navigation_tab_links template.
    Add the code in orange.
    Code:
    <ul class="secondaryContent blockLinksList">
        <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>
        <xen:if is="{$xenOptions.ctaFtFeaturedThreadsArchive.enabled}">
            <li><a href="{xen:link 'threads/featured-archive'}">{xen:phrase cta_ft_featured_threads_archive}</a></li>
        </xen:if>
        <xen:comment><xen:if is="{$xenOptions.enableNewsFeed}">
            <li><a href="{xen:link recent-activity}">{xen:phrase recent_activity}</a></li>
        </xen:if></xen:comment>
        <xen:if is="{$visitor.user_id}">
            <li><a href="{xen:link find-new/posts, '', 'recent=1'}" rel="nofollow">{xen:phrase recent_posts}</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:if is="{$visitor.user_id}">
                    <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}">{xen:phrase your_threads}</a></li>
                    <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=post'}">{xen:phrase your_posts}</a></li>
            </xen:if>
    </ul>
    
     
    Last edited: Feb 24, 2015
  5. Brogan

    Brogan XenForo Moderator Staff Member

    You need to use code=rich to be able to apply formatting to content in code tags.
     
    Amin Sabet likes this.

Share This Page