• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Add "Latest Threads" To Navbar

Jake Bunce

Well-known member
This will add a "Latest Threads" link to the navbar which shows a list of all threads from the last 30 days, unread or not. It looks like this:

Screen shot 2010-11-27 at 11.08.49 AM.webp

Edit this template:

Admin CP -> Appearance -> Templates -> navigation

Add this code:

Code:
						<li><a href="{xen:link 'find-new/threads', '', 'days=30'}">Latest Threads</a></li>

...as shown below:

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'}">
					<div class="primaryContent menuHeader">
						<h3>{$tabs.forums.title}</h3>
						<div class="muted">{xen:phrase quick_links}</div>
					</div>
					<ul class="secondaryContent blockLinksList">
						<xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'forums/-/mark-read', '', 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_all_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'}">{xen:phrase whats_new}</a></li>
						<li><a href="{xen:link 'find-new/threads', '', 'days=30'}">Latest Threads</a></li>
					</ul>
				</div>
			</li>
		</xen:if>

You can see the link is set to show the last 30 days of threads. You can change the number of days if you want.

The "Latest Threads" text is hard coded. You can put that into a phrase if your forum supports multiple languages. Otherwise it doesn't matter.
 
Hey Jake thanks for this guide, but I have a question.

Is it possible to create the secondary menu as a selectable drop down list?

For example, I would like to extend your Latest Threads to include a selectable drop down with several options for viewing threads.

What's New
New in last 24 hours
New in last 48 hours

I could make a link, changing the time frame for each of these, but how do I get them in a drop down list in the secondary menu? Is something like this possible?

Mock up of what I am talking about:

Latest_threads.webp
 
Hey Jake thanks for this guide, but I have a question.

Is it possible to create the secondary menu as a selectable drop down list?

For example, I would like to extend your Latest Threads to include a selectable drop down with several options for viewing threads.

What's New
New in last 24 hours
New in last 48 hours

I could make a link, changing the time frame for each of these, but how do I get them in a drop down list in the secondary menu? Is something like this possible?

Mock up of what I am talking about:

View attachment 6557


Should be plausible with some edits, custom code each element of the dropdown with the:

Code:
{xen:link 'find-new/threads', '', 'days=30'}

I'm at work now so I'm limited what I can do but when I get home if Jake hasn't beaten me to the punch like usual I'll see what I can do haha.
 
Is it possible to create the secondary menu as a selectable drop down list?

My kung fu is bad at menus. Go for it Russ. :p

In my opinion the expanded menu is unnecessary for this. It's enough to have just one link that shows a full 30 days. The search results are sorted by last post date so the user can already see, for example, posts from the last 24 hours inside of the 30 day listing.
 
hey Jake and Russ,

I have placed the link in my secondary menu like Jake explained and this works, but I wonder if this could be extended some.

When a member clicks the What's new link, if there are no new posts, it shows this:

no_results.webp


I would like to change this so if a member clicks the What's new link and there are no new posts, then it would tell them there is no new posts, but then display the latest threads instead.

Here is a mock up of what I am asking for:

If_no_new_latest.webp


Is something like this possible? Is there an If/Then statement that if the results were null/empty then show latest threads?

Thanks,
Jamie
 
In case someone is not aware, there is a All Recent Messages button now from the 'whats new' view. Click on Whats New, then towards the right there is a All Recent Messages button...

untitled.webp
 
That link only shows after clicking What's New, and only if there are threads shown on the What's New page.
Both true.

Ideally that button/link would still be there is there was no new threads. Think I should make a suggestion...
 
That link only shows after clicking What's New, and only if there are threads shown on the What's New page.
FYI - I tested V1.03, and on my test site when I clicked on whats new, the "You may view all recent threads instead." link shows up. (y)
 
Thanks for the tip. It would be great to have this as a selectable setting or some kind of navigation customization tool for a future release.
 
Check this out: http://xenforo.com/community/thread...op-down-rss-feeds-like-firefox-toolbar.25377/

Navigation Menu With Drop-Down RSS Feeds Like Firefox Toolbar

If you have firefox and know what an RSS feed toolbar looks like, then you know how useful and convenient it is. Most people on my site don't configure it. I would like to take advantage of this and create a 3rd navigation menu that houses feeds. This will make it easier for members to be updated on the latest news and find articles to talk about in the forum. The default registered feeds posts modification for xenforo is cool but I'd rather use this as user generated content is more desired on my site. This could even replace 'Latest Threads' if the forum's Global RSS feeds are added.

Screenshot:

RegisteredFeeds.webp
 
Top Bottom