Basic question: change the mobile menu options.
Hey do you know if I can change the items from the bottom menu on mobile? For example I need to remove the groups item and put a custom page (library
Yes, you can customize the mobile menu using the dedicated 'fluent_community/mobile_menu' filter hook.
Use the code below,
add_filter('fluent_community/mobile_menu', function($menuItems, $xprofile, $context) {
// Remove 'spaces' (groups) from mobile menu
$menuItems = array_filter($menuItems, function($item) {
return !isset($item['route']['name']) || $item['route']['name'] !== 'spaces';
});
// Add your custom page (library)
$menuItems[] = [
'route' => [
'name' => 'custom_page',
'params' => [
'slug' => 'library' // Your custom page slug
]
],
'icon_svg' => '<svg> your svg code </svg>'
];
return array_values($menuItems); // Re-index array
}, 10, 3);
You can also use a permalink instead of a route:
$menuItems[] = [
'name' => 'Library',
'permalink' => 'https://yoursite.com/portal/library',
'icon_svg' => '<svg>...</svg>'
];
Tawsif Ahmed RiyadΒ ah this is useful. Can I add also 5 menu items instead of 4?
Gee Adriaansz, as this is a filter hook, yes, you can.