I am trying to:
dynamically changing the Views.
Once some conditions happen, the Views need to update the values passed.
for example,
Im building up a menu with a View. If the user is logged in a different menu will show up.
I know I can make two different Views, but the conditions are quite many, it would be more useful to be able to pass the data dynamically.
thanks
Thank you for contacting us here in the Support Forum
1. Im building up a menu with a View. If the user is logged in a different menu will show up.
Depends where you put that menu you can either laid a different View or a View with some other ShortCode parameters using wpv-condtional.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
To load different WordPress menus itself, consult the WP API (example below)
function my_wp_nav_menu_args( $args = '' ) {
if( !is_user_logged_in() ) {
$args['menu'] = 'unlogged'; //the name of your menu for not logged users
}
elseif( (is_user_logged_in() ){
$args['menu'] = 'logged'; //menu for logged in users
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
I belive I replied to you with the possibilities you have for Views in this thread:
https://toolset.com/forums/topic/how-to-pass-variables-to-views/
Please let me know if you need further infos about this.
Thank you