我想在Joomla菜单中添加架构...!下面是代码
<?php
$menu = JFactory::getApplication()->getMenu();
// Get menu items - array with menu items
$items = $menu->getItems('menutype', 'mainmenu');
//print_r($items);
?>
<ul itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<?php foreach($items as $i => $menu_item){
?>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/"><?php if($menu_item->level == '1') { echo $menu_item->title; } ?></a>
<?php if($menu_item->level == '2') {?>
<ul>
<li><?php echo $menu_item->title; ?></li>
</ul><?php } ?>
</li>
<?php } ?>
</ul>
我面临的问题是,上面没有打印子菜单,我找不到任何解决方法
例如:
<ul itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">Home</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">DIFC</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">ADGM</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">About</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">Publications</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">FinTech: Now Everybody Wants A Slice of the Pie</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">The Role of Financial Centres in Emerging Economies</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">Bitcoin versus Ethereum </a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">ADGM</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">DIFC</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">Finance</a>
</li>
<li itemprop="name"><a itemprop="url" href="http://www.10leaves.ae/">Contact</a>
</li>
</ul>
发布菜单包含子菜单(FinTech)和另外两个。我不知道如何在子菜单中打印它们