XF 2.1 Quick question - Where do you edit the "New posts" button URL

beerForo

Well-known member
I want to edit the "New posts" button on the right side of forum view with /?skip=true so it removes the unread filter. Where can I edit this? Thanks
 
Template forum_overview_wrapper

Change this:
Code:
<xf:button href="{{ $xf.options.forumsDefaultPage == 'new_posts' ? link('forums/new-posts') : link('whats-new/posts') }}" icon="bolt">

To this:
Code:
<xf:button href="{{ $xf.options.forumsDefaultPage == 'new_posts' ? link('forums/new-posts', '', {'skip' : 'true'}) : link('whats-new/posts', '', {'skip' : 'true'}) }}" icon="bolt">
 
Template whats_new_wrapper

Change this:
Code:
<a class="{$baseClass} {{ $pageSelected == 'new_thread' ? {$selectedClass} : '' }}" href="{{ link('whats-new/posts') }}" rel="nofollow">{{ phrase('new_posts') }}</a>

To this:
Code:
<a class="{$baseClass} {{ $pageSelected == 'new_thread' ? {$selectedClass} : '' }}" href="{{ link('whats-new/posts', '', {'skip' : 'true'}) }}" rel="nofollow">{{ phrase('new_posts') }}</a>
 
Template whats_new_wrapper

Change this:
Code:
<a class="{$baseClass} {{ $pageSelected == 'new_thread' ? {$selectedClass} : '' }}" href="{{ link('whats-new/posts') }}" rel="nofollow">{{ phrase('new_posts') }}</a>

To this:
Code:
<a class="{$baseClass} {{ $pageSelected == 'new_thread' ? {$selectedClass} : '' }}" href="{{ link('whats-new/posts', '', {'skip' : 'true'}) }}" rel="nofollow">{{ phrase('new_posts') }}</a>

Thank you for this! Works great.

However since XFMG and XFRM and add-ons they do not appear in this template, and I have searched for these nav entries. If I wanted to edit:

New media
New media comments
New resources

...in this same nav bar, where would that be?

Thanks man!
 
You can't directly edit those links as they are added through a template modification.

You would have to disable that template modiification and add them to the template manually as you would like to.

xfmg-template-edit.png

Alternatively you could add another template modification with a higher execution order that changes the inserted HTML like you want.
 
Last edited:
Top Bottom