We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17546
    • 75 Posts
    The reply mode is out of order, I make a new topic.
    Related post:http://modxcms.com/forums/index.php/topic,47628.msg279646.html#msg279646


    Hello,

    I hacked the Wayfinder 2.3.1-pl version to add in the innerTpl the parent ID ressource.

    file
    core/components/wayfinder/wayfinder.class.php

    Line:20
    OLD CODE
    
        public $placeHolders = array (
            'wrapperLevel' => array (
                '[[+wf.wrapper]]',
                '[[+wf.classes]]',
                '[[+wf.classnames]]'
            ),
            'tvs' => array (),
    
        );
    
    NEW CODE
    
        public $placeHolders = array (
            'wrapperLevel' => array (
                '[[+wf.wrapper]]',
                '[[+wf.classes]]',
                '[[+wf.classnames]]',
       	    '[[+wf.parent]]'
            ),
            'tvs' => array (),
    
        );
    


    Line:257/258
    OLD CODE:
    $phArray = array($subMenuOutput,$useClass,$classNames);
    
    NEW CODE:
    $phArray = array($subMenuOutput,$useClass,$classNames,$docInfo['parent']);
    


    As you can see, it’s for only the parent ID ressource, you can perform and optimise this as you want.
    Do not forget to make a copy of the original class file for futur update.

    In my innerTpl, it’s look like :
    ...
    'innerTpl' => '@CODE:<ul class="sous-menu menu-haut-[[+wf.parent]]">[[+wf.wrapper]]</ul>',
    ...
    


    Have a good day!
    Low.


    Hope we can in the futur add this with a official release.
      Low
      • 32699 ☆ A M B ☆
      • 427 Posts
      Interesting. Did you have to notice the changelog for the version just before the one you edited?

      Wayfinder 2.3.1
      ====================================
      - [#31] Add &scheme property for specifying link schemes
      - [#27] Improve caching in Wayfinder to store cache files in resource cache so cache is synced with modx core caching
      
      Wayfinder 2.3.0
      ====================================
      - [#14] Fix issue with hideSubMenus when using it with a non-zero startId
      - Add all fields of a Resource to the rowTpl placeholder set, such as menutitle, published, etc
      - Properly optimize TV value grabbing to properly parse and cache TVs to improve load times when using TVs in a result set
      - Ensure that caching also caches by user ID to persist access permissions through cached result sets
        Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

        Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
        • 17546
        • 75 Posts
        Hi,

        All fields are available under the rowTpl, not the innerTpl.
        My problem is that under the innerTpl I want to reach some of them !

        Low
          Low
          • 34536
          • 4 Posts
          I need something like this...
          I need to parse "attributes" in the innerTpl...
          (its for a dropdown menu, where I need to give each Top menu item, a special style attribute)

          Can you tell me how to do that? ... I’ve tried with something similar to what you wrote here, but dont worked.
          I need innerTpl put some class or style in each UL getting ...but it dont even show doc id or anythign I can use to make something like this.

          Thanks in advance.
            _______________________________________________________________________
            CAS company :: www.cascompany.com
            Dedicated Servers | Cloud Servers | Cloud Hosting | Hosting | Resellers