XF 2.1 Public Navigation to Logged in and Logged out User

Will Franco

Active member
The display conditions are the same of these two tabs:

{$xf.options.forumsDefaultPage} != 'new_posts'

{$xf.options.forumsDefaultPage} != 'forums'

But the first display to both logged in and logged out users. Whereas, the second displays to both?

What am I missing? Many thanks,
 
Reframe (again). How do I set the display permissions for public navigation? In other words, the navigation elements an unregistered/unconfirmed user and the registered user sees?
 
Set the display condition to !$xf.visitor.user_group_id == 1 to display the navigation tab for unregistered/unconfirmed only, or $xf.visitor.user_state == 'valid' to display only to valid users.

If the display condition is already specified, you can add to the condition &&, for example $xf.visitor.canViewMemberList() && $xf.visitor.user_state == 'valid' to display the tab only if the visitor can view the list of members and the visitor is a valid user.
 
The conditions for displaying the navigation tabs do not set permissions to view the pages, you need to create an extension for the desired class and define all the necessary permissions in the code 🤷‍♂️
 
Top Bottom