如何获得定制的Joomla菜单以及子菜单



我想在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(和两个子菜单。我不知道如何在子菜单中打印它们

您是否可以不尝试Tassos Marinos 的此扩展

Dave

相关内容

  • 没有找到相关文章

最新更新