Hi Felipe,
Thank you for contacting us and I'd be happy to assist.
There is no direct built-in feature available in Toolset plugins, which can insert the menu items in a navigation menu, dynamically.
It will require customization, with a good understanding and familiarity with PHP and WordPress navigation menu related functions.
As much as we would like to help, 1-1 custom code assistance of this scale is beyond the scope of support that can be provided over the forum. But, we do our best to guide in the right direction, whenever possible.
This requirement can be broken down into 3 main parts:
1. The URL structure of the sub-menu items:
The way the view on the "Terapeutas" page works ( hidden link ), you just need to specify the value of the neighborhood in the URL parameter "wpv-wpcf-bairro-rj", to make it pre-populate the listings from that neighborhood only.
For example:
Barra da Tijuca
hidden link
Botafogo
hidden link
2. Getting the labels of all the available neighborhood custom field labels and values:
For this, you can create a raw post view which loops through all the listing posts and only returns the available neighborhood custom field labels (e.g. Botafogo) and values (e.g. 14).
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/ )
The output of that view can then be called in a PHP code so that these labels and values can be used to create sub-menu item links.
( ref: https://toolset.com/documentation/programmer-reference/views-api/#render_view )
3. Adding sub-menu items, dynamically into a navigation menu:
Here are some useful WordPress functions which can be used for this:
- wp_get_nav_menu_items
https://developer.wordpress.org/reference/functions/wp_get_nav_menu_items/
- wp_create_nav_menu
https://developer.wordpress.org/reference/functions/wp_create_nav_menu/
- wp_update_nav_menu_item
https://developer.wordpress.org/reference/functions/wp_update_nav_menu_item/
Here is a thread with good usage example of programmatically generated navigation menu items:
https://wordpress.stackexchange.com/a/44739
I hope this helps and for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar