XF 2.1 Public Navigation to Logged in and Logged out User

Will Franco

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,
 

Will Franco

Member
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?
 

NikitOS

Active member
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.
 

NikitOS

Active member
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