2

I´ve got this template from my Contao CMS:

<?php $helper = new \ContaoBootstrap\Navbar\Helper\NavigationHelper($this); ?>


<?php foreach ($this->items as $item) : ?>

    <?php
        $currentLevelStringParts = explode('_', $this->level);
        $currentLevelNumber = $currentLevelStringParts[1];
    ?>

    <?php $itemHelper = $helper->getItemHelper($item); ?>

    <li class="<?php echo str_replace(array('_'), array('-'), $itemHelper->getItemClass());
                if (!empty($item['subitems'])) {echo ' subnav';} ?>
    ">

        <<?= str_replace(array('strong'), array('a'), $itemHelper->getTag()); ?>
        <?= str_replace(array('dropdown-item', 'dropdown-toggle', 'nav-link', 'data-toggle="dropdown"'), array(' ', ' ', ' ', ' '), $itemHelper) ?>>

        <?php if ($item['isActive']) : ?>
            <?= $item['link']?>
        <?php else : ?>
            <span itemprop="name"><?= $item['link']?></span>
        <?php endif; ?>
        </<?= str_replace(array('strong'), array('a'), $itemHelper->getTag()); ?>>

        <?php if (!empty($item['subitems'])) { ?>
            <span class="subnav-pull-down hidden-lg-up <?php if ($item['isTrail']) : ?>active<?php endif; ?>"></span>

        <div class="subnav-container <?php if ($item['isTrail']) : ?>open<?php endif; ?>">
            <div class="relative">
                <ul class="nav sub-nav level-<?php echo (int)$currentLevelNumber+1 ?>">
                    <?= $item['subitems'] ?>
                    <div class="clear"></div>
                </ul>

            </div>
        </div>
    <?php } ?>
    </li>
<?php endforeach; ?> 

My problem is, I need a HTML structure like:

<ul>
<li><a></a></li>
<li><a></a></li>
<li>
<ul>
<li><a></a></li>
</ul>
</ul>

To change link () and description for my navigation. I tried to work the the bootstrap API but I´m kind of new to PHP and Bootstrap.

I hope you guys can help me.

fr3d
  • 665
  • 1
  • 5
  • 17
  • You need to provide more information here or in your Contao Forum thread. I am not sure what you are trying to do. – fritzmg Aug 28 '18 at 08:19

0 Answers0