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

Find all content

Discussion in 'XenForo Questions and Support' started by Cees50, Nov 27, 2012.

  1. Cees50

    Cees50 Active Member

    In the profile page of a user, in the tab postings, there are beneath two links.

    one is Find all content by {name}
    the other one is Find all threads by {name}

    My users dont find those links. They are all vB users...
    Where and what do i have to change, so the two links are in the navtab of the forum beside the whats new?
     
  2. Cees50

    Cees50 Active Member

    Find the place where i can place that. Its in navigation template.

    But if i place this
    Code:
    <ul>
                                        <xen:hook name="member_view_search_content_types">
                                        <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                                        <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
                                        </xen:hook>
    Then i get an error. It cant find the member... Must i place some code more?
     
  3. ManOnDaMoon

    ManOnDaMoon Well-Known Member

    The links in the profile are not search links, they are actions from the members controller:
    http://xenforo.com/community/members/cees50.15174/recent-content
    http://xenforo.com/community/members/cees50.15174/recent-activity

    So your code should more look like
    Code:
    <ul>
                                        <xen:hook name="member_view_search_content_types">
                                        <li><a href="{xen:link members/recent-content, {$user.user_id}}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                                        <li><a href="{xen:link members/recent-activity, {$user.user_id}}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
                                        </xen:hook>
    Untested, have a go and tell me if it works.
    EDIT : fixed bad copy/paste.
     
    Jake Bunce likes this.
  4. ManOnDaMoon

    ManOnDaMoon Well-Known Member

    Also, you want it to appear in the navtab but I'm not sure the $user template var is accessible from there. This is probably the cause of your error.

    On a side note, placing those links related to the main content into the navigation area is not a good practice IMHO. But I assume you know your users better than I do. ;)
     
    Jake Bunce likes this.
  5. Cees50

    Cees50 Active Member

    No that doesnt work, Got an error while compiling
     
  6. Cees50

    Cees50 Active Member

    My users... They are vB users and are struggling to learn. So i try to get it as easy as possible. Never want to go back:)
     
  7. Cees50

    Cees50 Active Member

    Tried the new version.. didnt work. still get the error message that it cant find the user
     
  8. ManOnDaMoon

    ManOnDaMoon Well-Known Member

    It seems I misunderstood your question, and submitted the wrong links. Yours were OK from the start, so forget about my first post.

    Finally, I checked and the $user template var is not usable in the navigation template. You have two options :
    - either these links are supposed to give a user the ability to find its own posts : then you can use your links but replace the $user.user_id var with $visitor.user_id :
    Code:
    <ul>
                                        <xen:hook name="member_view_search_content_types">
                                        <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$visitor.username}'}</a></li>
                                        <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$visitor.username}'}</a></li>
                                        </xen:hook>
    - or you want these links to be related to the user profile that is beeing shown, thus the only option is to move these links from their place in the member_view template to somewhere else in the same template, e.g. under the avatar: find
    Code:
    <xen:include template="ad_member_view_below_avatar" />
    and add below
    Code:
    <a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a>
    <a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a>
    The result is as follows: Capture.PNG Then do a little styling and you're done.
     
    Jake Bunce likes this.
  9. Cees50

    Cees50 Active Member

    That did it. Thanks for youre help. My users will be gratefull!!;)
     
  10. Cees50

    Cees50 Active Member

    Upgraded to 1.1.4 and now this is not working anymore. do i need a change??
     
  11. Andrej

    Andrej Well-Known Member

    Have you reapplied the template edit?
     
  12. Cees50

    Cees50 Active Member

    Yes i did :) But somewere its going wrong,

    This is what i did
    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/threads'}">{xen:phrase watched_threads}</a></li></xen:if>
                            <li><a href="{xen:link 'find-new/threads'}" rel="nofollow">{xen:phrase whats_new}</a></li>
                         
    <xen:hook name="member_view_search_content_types">
      <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$visitor.username}'}</a></li>
                                        <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$visitor.username}'}</a></li>
    </xen:hook>
                                        </xen:hook>
     
                        </ul>
                    </div>
                </li>
    
     
  13. ManOnDaMoon

    ManOnDaMoon Well-Known Member

    Read again my post ;) You have two options. The one you chose is for the current visitor only, so you must replace $user.user_id with $visitor.user_id
    For specific user links, you have to edit the member_view template.
     
  14. Cees50

    Cees50 Active Member

    Picked the wrong code, changed it in the one i use. .. It wouldnt show up. Now it does again. And i didnt changed a thing???? Thanks for the help. its a mystery :censored:
     

Share This Page