• 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

#1
hey,

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

Did someone know ?

Thanks :)
 

RichardKYA

Well-known member
#2
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
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:

RichardKYA

Well-known member
#4
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
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.
 

Ludachris

Well-known member
#9
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.
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
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.
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>
 

Ludachris

Well-known member
#11
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>
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?