0

I want add schema in my Joomla menu...! Below is code

<?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>

problem I am facing is, above not printing sub-menu I could not find any solution

For Example :

<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>

Publication Menu has submenu (FinTech) and two more. I cannot figure it out how to make them print in Submenu

Ronald Joseph
  • 45
  • 1
  • 13
  • When you have Joomla-specific issues/questions in the future please post them at Joomla Stack Exchange to reach a dedicated audience for support. Team Joomla _wants_ you to post there, that's why in the administrator -> Help menu, the 2nd last item in the dropdown is **Stack Exchange**. That link takes you to JSE. – mickmackusa Oct 04 '18 at 04:24

1 Answers1

1

Could you not try this Extension from Tassos Marinos

Dave

Davec62
  • 26
  • 2
  • This link-only answer is low-value because links die. Please put more permanent details in this answer. If you are able to solve Joomla-centric issues, please create a Joomla Stacke Exchange account and share your expertise with the community that is dedicated to serving Joomla. ...where are you from Dave? wanna add a location to your profile? – mickmackusa Oct 04 '18 at 04:18