On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Good day, MODX experts! I decided to try to display the menu using pdoMenu
    The 3-level menu, everything is displayed, only here, for some reason, on those resources where there should be an anchor link, when clicking on which the next menu item opens, it is duplicated.

    <li><a href="url" title="item-1-3">item-1-3</a></li>
    <li class="icon icon-arrow-right"><a href="#" title="item-1-3">item-1-3</a>
    


    This is how it looks in code
    <nav id="mp-menu" class="mp-menu mp-cover">
        <a href="#" class="close-menu"><i class="fas fa-times"></i></a>
    	<div class="mp-level mp-level-open" data-level="1">
            <ul>
    			<li class="icon icon-arrow-right"><a href="#" title="item-1">item-1</a>
    				<div class="mp-level" data-level="2">
    				<a class="mp-back" href="#" rel="nofollow">Back</a>
    					<ul>
    						<li><a href="url" title="item-1-1">item-1-1</a></li>
    						<li><a href="url" title="item-1-3">item-1-2</a></li>
    						<li><a href="url" title="item-1-3">item-1-3</a></li>
    						<li class="icon icon-arrow-right"><a href="#" title="item-1-3">item-1-3</a>
    							<div class="mp-level" data-level="3">
    								<a class="mp-back" href="#" rel="nofollow">Back</a>
    								<ul>
    									<li><a href="url" title="item-1-3-1">item-1-3-1/a></li>
    									<li><a href="url" title="item-1-3-2">item-1-3-2</a></li>
    									<li><a href="url" title="item-1-3-3">item-1-3-3</a></li>
    								</ul>
    							</div>
    						</li>
    					</ul>
    				</div>
    			</li>
    		</ul>			
    	</div>
    </nav>
    

    It should look like this
    <nav id="mp-menu" class="mp-menu mp-cover">
        <a href="#" class="close-menu"><i class="fas fa-times"></i></a>
    	<div class="mp-level mp-level-open" data-level="1">
            <ul>
    			<li class="icon icon-arrow-right"><a href="#" title="item-1">item-1</a>
    				<div class="mp-level" data-level="2">
    				<a class="mp-back" href="#" rel="nofollow">Back</a>
    					<ul>
    						<li><a href="url" title="item-1-1">item-1-1</a></li>
    						<li><a href="url" title="item-1-3">item-1-2</a></li>
    						<li class="icon icon-arrow-right"><a href="#" title="item-1-3">item-1-3</a>
    							<div class="mp-level" data-level="3">
    								<a class="mp-back" href="#" rel="nofollow">Back</a>
    								<ul>
    									<li><a href="url" title="item-1-3-1">item-1-3-1/a></li>
    									<li><a href="url" title="item-1-3-2">item-1-3-2</a></li>
    									<li><a href="url" title="item-1-3-3">item-1-3-3</a></li>
    								</ul>
    							</div>
    						</li>
    					</ul>
    				</div>
    			</li>
    		</ul>			
    	</div>
    </nav>
    


    Call snippet
    [[!pdoMenu? 
                &parents=`18,14,29`
                &outerTpl=`outerTpl` 
                &rowTpl=`innerRowTpl` 
                &innerTpl=`menuRow` 
                &innerRowTpl=`menuRowTpl` 
                &showUnpublished=`1` 
                &level=`3`
                &offset=`1`
                &limit=`0`
                &ignoreHidden=`1`
                &tplStart=`@INLINE [[+wrapper]]`
                &displayStart=`1`
            ]]
    

    outerTpl:
    <ul>[[+wf.wrapper]]</ul>


    innerTpl:
    <li class="icon icon-arrow-right"><a href="#" title="[[+wf.title]]">[[+wf.linktext]]</a><div class="mp-level">
        	<a class="mp-back" href="#" rel="nofollow">Назад</a>
    	<ul>[[+wf.wrapper]]</ul>
        </div>
    </li>

    innerRowTpl:
    <li class="icon icon-arrow-right"><a href="#" title="[[+wf.title]]">[[+wf.linktext]]</a><div class="mp-level">
        <p class="h4">[[+wf.textlink]]</p>
    	<a class="mp-back" href="#" rel="nofollow">Назад</a>
    	<ul>[[+wf.wrapper]]</ul>
        </div>
    </li>

    и innerRowTpl:
    <li><a href="[[+wf.link]]" title="[[+wf.title]]">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>


    Please direct where I was wrong (
    • Anton Tarasov Reply #2, 2 months ago
      Just play with chunks (especially with inner* and parent*, I don't see you use it) and you'll find the answer, this is what I do when have the same problem as yours.
      Here is some diagram for pdoMenu predecessor, Wayfinder: https://docs.modx.com/extras/revo/wayfinder/wayfinder-introductory-examples, maybe this will help you a bit.

      You're noticed innerRowTpl twice but I don't see first example usage at all.
        Anton Tarasov
        MODX Developer

        Email: contact@antontarasov.com
        Web: antontarasov.com