We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17229
    • 4 Posts
    hi everyone, im new to modx and love it! its a good learning curve, but i am now learning how to design with CSS and dynamic websites!! awesome! you guys rock!

    anyway, i am trying to design a site with multiple menus, and read that the best way to do this is to have wayfinder startid= be different in differnet menus. which i understand. but the problem i am having is once a create a document, it assigns a doc ID, but if i delete the document for whatever reason, that ID tag is not used. it increments to the next available number.

    this can cause some problems in ordering the list in these multiple menus.

    my question is.. is it possible to change the Document ID so that i can number them as needed??

    also.. how could i create a menu with only certain menu items (documents) with out them having to be in order?
      • 3749
      • 24,544 Posts
      By default, Wayfinder orders the menu by the Menu Index number of each document (which you can change on the Create/edit Document screen), not by document ID.

      If Wayfinder is ordering your documents by DocID (and you haven’t told it to do that with a parameter), it probably means you are using MySQL 5.0.51, which has a bug that causes that problem.

      Some people have solved the problem by manually editing the Document ID numbers in the database, but that would make me nervous and would screw up any document groups you might have.

      Another solution (what I’m doing for now) is to take out the "GROUP BY" clause in the SQL query in line 352 of the wayfinder.inc.php file in assets/snippets/wayfinder

      $sql = "SELECT DISTINCT {$fields} FROM {$tblsc} sc LEFT JOIN {$tbldg} dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND ({$access}){$menuWhere} AND sc.id IN (".implode(',',$ids).")  ORDER BY {$sort} {$this->_config['sortOrder']} {$sqlLimit};";
                     //took this out of above (came before order by): GROUP BY sc.id


      This can create other problems, but seems to be working for me. I’ll change it back when the MySQL bug is fixed.

      Of course the best solution is for you (or your hosting service) to upgrade or downgrade away from 5.0.51.

      Hope this helps,

      Bob
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 17229
        • 4 Posts
        thank you Bob!

        really appreciate the response.

        i think it clears things up about the Menu Index. i was thinking it was ordering them by Doc ID.

        i’m just trying to figure out a way to have certain menu items in certain menus.

        for example..
        =====================
        menu1 - Home | About Us | Services | Products | Sitemap | Contact

        menu2 - Home | Sitemap | Contact
        =====================

        basically using select pages in more than one menu. do you know if this is pssible?

          • 3749
          • 24,544 Posts
          Set the MenuIndex of Home to 0 and the menuIndex of Sitemap and Contact to 98 and 99. As long as you have less than 100 pages, it should work.

          Bob
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 10487 MODX Staff
            • 1,535 Posts
            basically using select pages in more than one menu. do you know if this is pssible?
            Another idea is that you could create a folder containing weblinks (pointing to your pages) for each menu you want to generate and then use Wayfinder to produce the menus from your weblink folders. That way, you could have custom ordering in each menu by ordering your weblinks. (Wayfinder should be able to parse the weblinks for you, at least from what I can remember)

            I’ve done this a few times but it all depends on how many menus we’re talking about here as it might get cumbersome if you have more than a few menus.
              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Yes, Wayfinder will create links directly from the value you put in the weblink’s field. If you click on the little folder next to the field, then on the document you want to link to, it will insert that document’s ID, and Wayfinder will automatically generate the proper link for the document. No more redirects.

              http://sottwell.com/article-weblinks.html
                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