XF 2.0 All Posts in What's New menu select issue

ibaker

Well-known member
My users want to both access posts that they have not read and others want to just access all posts whether they have read them or not. XF v2 has the filter system for this but they just want a menu item for both so I have added an extra menu item adding the ?skip=1 1.e.:
Code:
    <a class="{$baseClass} {{ $pageSelected == 'new_thread' ? {$selectedClass} : '' }}" href="{{ link('whats-new/posts/?skip=1') }}" rel="nofollow">Posts (All)</a>

This shows:
1.webp

Now the issue is when the user selects the Posts (All) option. Due to the code have the same page selected i.e.:
Code:
$pageSelected == 'new_thread'
Both the Posts (Unread) and Posts (All) options are selected i.e.:
2.webp

Can anyone PLEASE advise how I can correct this...thanks for your help
 
My users are split between wanting to have the Whats New display either just the Unread Posts or All New Posts (read and unread) so I need to give them an option of either. The default will be the Unread option but I want to add the All option to the What's New Menu

So, in the whats_new_wrapper template I have the following 2 lines, the 2nd one I added to show ALL by using the "skip=1" to the link:
Code:
    <a class="{$baseClass} {{ $pageSelected == 'new_thread' ? {$selectedClass} : '' }}" href="{{ link('whats-new/posts') }}" rel="nofollow">{{ phrase('new_posts') }}</a>
    <a class="{$baseClass} {{ $pageSelected == 'new_thread' ? {$selectedClass} : '' }}" href="{{ link('whats-new/posts/?skip=1') }}" rel="nofollow">{{ phrase('new_posts_all') }}</a>

However both menu options are highlighted:
1.webp

Can anyone help me with what code I need to change so each one is highlighted when chosen...thanks for your help
 
Back
Top Bottom