Ah cool, that DOES look very interesting!
I was wundering how you can declare global data (such as menu’s etc), regardless of the body class?
Can you use some kind of wildcard or are you supposed to add a global body class and then use the filter on that? Something like this:
base.blade.php:
<body @php(body_class('global'))>
controllers.php:
function globalData() {
$main_menu = wp_get_nav_menu_items('Primary Navigation');
if ($main_menu) {
$data['main_menu'] = $main_menu;
}
return $data;
}
add_filter('sage/template/global/data', 'App\\globalData');
Thanks!
EDIT: This is not working unfortunately, it doesn’t pick up my added body class global, it only recognizes the body classes added by the sage filter.