We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    that tells MODX to use relative URLs, but we need absolute URLs. Wayfinder/pdoMenu doesn't look at that system_settings value, so you have to also specify it in the snippet call.

      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
      • 39658 ☆ A M B ☆
      • 106 Posts
      Ok, resume. This is what I have:

      1. Working on a new server (the old site is up and running on the old host), domain name not moved yet, redirect to new server via hosts file.
      2. Working with a subdir for Context2. The site is divided in two: www.domain.tld and www.domain.tld/context2.
      3. Resources in context2 need a different (Wayfinder) menu, different site_name, etc.
      4. I installed Xrouting.

      The problem:
      Context1 is working fine. Resources in Context2 do not show the correct menu, site_name, templates. Instead they use the default (?) template of Context1, site_name of Context1, etc.

      Settings context1 (web):
      base_url- /
      http_host- domain.tld
      site_url- http://domain.tld/ (yes, without 'www.' and trailing slash)

      Settings context2 (Context2):
      base_url- /context2/
      http_host- domain.tld/context2
      site_url- http://domain.tld/context2/
      site_name- Context2
      site_start- 6

      Wayfinder settings context1 (web):
      [[Wayfinder?
      &startId=`0`
      &level=`2`
      &contexts=`web`
      &scheme=`abs`
      &outerTpl=`Wayfinder.outerTpl`
      &innerTpl=`Wayfinder.innerTpl`
      &parentRowTpl=`Wayfinder.parentRowTpl`
      &innerRowTpl=`Wayfinder.innerRowTpl`
      &rowTpl=`Wayfinder.rowTpl`
      ]]

      Wayfinder settings context2 (Context2):
      [[Wayfinder?
      &startId=`6`
      &level=`2`
      &contexts=`Context2`
      &scheme=`abs`
      &outerTpl=`Wayfinder.outerTpl`
      &innerTpl=`Wayfinder.innerTpl`
      &parentRowTpl=`Wayfinder.parentRowTpl`
      &innerRowTpl=`Wayfinder.innerRowTpl`
      &rowTpl=`Wayfinder.rowTpl`
      ]]

      System setting:
      link_tag_scheme- abs
      Friendly URL's enabled (both system settings and htaccess) [ed. note: handjes last edited this post 11 years, 7 months ago.]
        • 38415 ☆ A M B ☆
        • 70 Posts
        Settings context2 (Context2):
        base_url- /context2/
        http_host- domain.tld/context2
        site_url- http://domain.tld/context2
        site_name- Context2
        site_start- 6

        The http_host of context 2 is wrong! It needs to be *just* the http_host! So "domain.tld" would be correct!
          chsmedien - Digital Marketing Agency
          MODX Professional & Ambassador

          http://chsmedien.com | http://twitter.com/christianseel
          • 39658 ☆ A M B ☆
          • 106 Posts
          That's it! It's working. What a relieve.

          A good manual for Xrouting might be more than welcome. It's just a lot of guessing right now.
            • 39658 ☆ A M B ☆
            • 106 Posts
            Except for the Wayfinder menu: there is no menu in Context2. When I change site_start to '0' it shows the context1 menu. But when I change it to '6' (which is Home in Context2) it does not show any menu at all.
              • 38415 ☆ A M B ☆
              • 70 Posts
              First you don't need to specify the Contexts in Wayfinder, it defaults to the current context. Then you need to make sure that your resources in context 2 are published and not hidden from menus. Can you double-check that?
                chsmedien - Digital Marketing Agency
                MODX Professional & Ambassador

                http://chsmedien.com | http://twitter.com/christianseel
                • 39658 ☆ A M B ☆
                • 106 Posts
                Resources are published. With or without
                &contexts=`Context2`
                in the Wayfinder snippet does not work. The menu won't show in Context2.
                  • 38415 ☆ A M B ☆
                  • 70 Posts
                  That's wired! I currently have no idea what could cause this in your project. It's working in my projects without issues.

                  If you want I could take a look into your manager, if you can provide access for me. (You could just send that via twitter)
                    chsmedien - Digital Marketing Agency
                    MODX Professional & Ambassador

                    http://chsmedien.com | http://twitter.com/christianseel
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Remember, &startId is the parent, Wayfinder will generate the menu from that resource's children. So even in the other context, the parent you want selected from is still 0 to get top-level items in the menu.
                      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
                      • 38415 ☆ A M B ☆
                      • 70 Posts
                      Oh, Susan is absolutely right! I missed that while reading the posts. Handjes, can you check that?
                        chsmedien - Digital Marketing Agency
                        MODX Professional & Ambassador

                        http://chsmedien.com | http://twitter.com/christianseel