Hello!
So i have these Databoject
class DishCategory extends DataObject {
private static $has_many = [
'Dishes' => 'Dish'
];
}
class Dish extends DataObject {
private static $has_one = [
'DishCategory' => 'DishCategory'
];
}
I'd like to add them in pages this way
<% loop $DishCategory %>
$Title
<% loop $Dishes %>
$Title
<% end_loop %>
<% end_loop %>
to get the display
Category 1
Dish 1.1
Dish 1.2
Dish 1.3
Category 2
Dish 2.1
Dish 2.2
Dish 2.3
...
corr: sorry this actually works... the problem was a mistake i did in my code so... nvm ^^
Bye