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

XF 1.4 My content, display results as threads in navbar

Discussion in 'Styling and Customization Questions' started by aana, Apr 23, 2015.

  1. aana

    aana Member

    hey,

    i would like to know how to add a navbar link : My content ( but display results as threads ).

    Did someone know ?

    Thanks :)
     
  2. RichardKYA

    RichardKYA Well-Known Member

    If I understand you correctly...

    Add this link to where you need it. This is the link only without any other tags or classes, you will have to add those to match it's location.

    Code:
    <a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}" rel="nofollow">{xen:phrase your_content}</a>
    
    And either change the phrase "your_content" to display "My Content" or create a new phrase instead and replace it in this line of code.
     
  3. aana

    aana Member

    hey,

    thx :)

    That's for display the thread i have created ?
    i would like to have this one on the navbar.
    searsh post.jpg
     
    Last edited: Apr 23, 2015
  4. RichardKYA

    RichardKYA Well-Known Member

    Yes, the link I gave you will display all the threads that you have created and is effectively the same search request that you have shown in your image.

    I have changed my navbar completely, so I can't really say where exactly you would have to put the link, but it will either be in the navigation template or the navigation_visitor_tab template depending on where you want it to show up.
     
  5. aana

    aana Member

    Ho ok,

    i am looking to have all the posts i did display as thread, even when i didn't created the thread. All my post but not display as message.
     
  6. RichardKYA

    RichardKYA Well-Known Member

    Ah OK, sorry I misunderstood what you wanted lol :D
     
  7. aana

    aana Member

    np:)

    did someone know ?
     
  8. RichardKYA

    RichardKYA Well-Known Member

    It must be possible, but unfortunately, I don't know how. sorry :unsure:
     
  9. Ludachris

    Ludachris Well-Known Member

    I have a similar link in my nav bar that used to work but for some reason it is not working now - when I click the link myself the results are empty. I'm using Elastisearch and have rebuilt the search index a few weeks back. Does this mean I have to rebuild the search index again?
     
  10. Demon

    Demon Active Member

    This is the correct code to place in the navigation template:
    Code:
    <xen:if is="{$visitor.user_id}">
             <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}" rel="nofollow">{xen:phrase your_content}</a></li>
    </xen:if>
    
     
  11. Ludachris

    Ludachris Well-Known Member

    That will return all threads started by the member... what if it's not returning more than a few threads? Which cache should be rebuilt? Search? User? Threads?
     

Share This Page