We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36926
    • 701 Posts
    Hi,

    I have a large site 3k plus pages with a wayfinder call. I can't call wayfinder cached due to there being a members only area within the menu. So wondering how best to deal with this as it's really slowing the site down.

    There are actually only 30 odd pages needed within the menu. Does anyone know if you pass a list of documents to include this will be quicker as it will only process the ID specified.

    I'm thinking possibly the only option is some kind of custom snippet or maybe doing something with getCache where i cache the different versions of the menu and then have a snippet return the correct one depending on permission.

    Ben

    This question has been answered by Bruno17. See the first response.

    • discuss.answer
      • 4172
      • 5,888 Posts
      yes, you can use getCache as a wrapper to get the different versions cached.

      And have a look at pdoTools and its pdoMenu - snippet, if it doesn't generate the menu faster, than wayfinder.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Another interesting feature of pdoMenu is that instead of a single &startId property, it has a &parents property, much like getResources. You can also use it with a - sign, -42, to exclude the children of #42.

        &parents - List parents, separated by commas, to search for results. By default, the result is limited to the current parent. If set to 0 - unlimited. If the parent id starts with a hyphen, it and its children are excluded from the result.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 36926
          • 701 Posts
          Great thanks both, not used either before so will check them out.
            • 36926
            • 701 Posts
            Wow it's so much quicker smiley a good couple of seconds.

            When did pdoTools suddenly appear, think I'm going to be replacing all my wayfinder and getResources with this.

            I couldn't see anything in the docs about placeholders
            http://docs.modx.pro/en/components/pdotools/snippets/pdomenu

            So i've just used the same as wayfinder which seems to of worked.

            Thanks again.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              It's been around for a while now. It does provide support for most Wayfinder-style properties and placeholders, but also has its own. You can skip the wf. prefix for the placeholders. Although it's in Russian, you can get more insight by looking at the examples in the Russian documentation. For example,
              [[pdoMenu?
                  &parents=`0`
                  &level=`2`
                  &tplInner=`@INLINE [[+wrapper]]`
                  &tplParentRow=`@INLINE <li[[+classes]]><a href="[[+link]]" [[+attributes]]>[[+menutitle]]</a> ([[+children]])</li>[[+wrapper]]`
                  &countChildren=`1`
              ]]
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 36926
                • 701 Posts
                Quote from: sottwell at Dec 09, 2014, 07:56 PM
                Although it's in Russian, you can get more insight by looking at the examples in the Russian documentation. For example,

                Great thanks Susan.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Watch out for pdoResources when using TVs. With getResources, there are two properties, one boolean to use/not use TVs, and one to list TVs to use (if not all of them). With pdoResources, there is only one property, a list of TVs to use.

                  There are a few differences like this, but for the most part pdoMenu ~ Wayfinder, and pdoResources ~ getResources.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org