While:
<?php foreach($pages->find('menu')->children() as $menu): ?>
<?php echo $menu->title()->html() ?>
<?php endforeach ?>
outputs the correct title, the following code:
<?php foreach($pages->find('menu')->children() as $menu): ?>
<img src="<?php echo $menu->image()->url() ?>" alt="" class=""/>
<?php endforeach ?>
results in an error (Call to a member function url() on null).
What do I missing?
The image is located in:
content/
content/menu
content/menu/1-restauant
content/menu/1-restauant/vegetables.jpg