We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21136
    • 103 Posts
    Hello smiley

    I have a strange question about Wayfinder and hope there is an easy answer.

    Is it easily possible to have wayfinder only display the menu when an external java script is executed? In other words, the page loads and executes "script.js" - then wayfinder checks to see if this JS file has executed. Only if it has executed will it display the menu.

    Let me now explain why I need this to happen... It’s based around SEO

    The purpose of this is to keep the spiders from following the linking structure in the menu. Since the spiders can’t execute an external java script then that would keep the menu from being displayed when the spider came through.

    Or maybe is there an easy way to execute wayfinder directly from the java script? I really don’t care how I accomplish this as long as the end results are attained.

    Regards,

    Ken Roberts
    • Your idea cannot work. Wayfinder is executed on the server. Javascript is executed by the client.

      The only possible way to do something like this is to have a menu generating snippet that generates javascript code that will display the menu once it is executed on the client, or with Ajax. Easy? No.
        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
        • 21136
        • 103 Posts
        Bummer

        Thanks smiley