We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42502
    • 12 Posts
    Hi
    is it possible to sort menu elements by menuindex using multiple contexts in wayfinder?

    i'm trying something like this

    [[!Wayfinder?
    &startId=`0`
    &level=`2`
    &sortBy=`menuindex`
    &sortOrder=`ASC`
    &contexts=`web,web2`
    &scheme=`full`
    ]]

    Wayfinder sorts results but only in contexts not crosscotext. first are elemenst from context "web" and next from "web2"
    is it possible to merge them?

    maybe there is another, smarter way to build complicated menu? (i'm going to have about 6 contexts)


      • 42562
      • 1,145 Posts
      I don't understand. What do you mean merge?
      Wayfinder, I think, treats Contexts as Parents, just as it does Resource Containers. What do you mean by sort by menuindex? You mean how they are arranged in your Resource tree in the left side bar of manager? I think it does that already by default.
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 42502
        • 12 Posts
        ok i have two cotexts (web1, web2) with pages (page:menuindex)

        web1
        - home:1
        - about:2
        - info:4
        - contact:6

        web2
        - products:3
        - shop:5


        now if i sort wayfinder by menuindex result will be:
        home, about, info, contact, products, shop

        what i need is to have it in this order:
        home, about, products, info, shop, contact

        maybe there is some trick to force order wayfinder?
          • 43864
          • 151 Posts
          If I understand it right then you only have to put your menuindex in the right order and the job will be done. If you want to include or exclude certain documents than you can use includedocs or excludedocs. I used it in a website I made with different menu's (www.delaere.be) where it was not possible to use the basic setting of wayfinder.
            • 42562
            • 1,145 Posts
            You see, Shop is the child resource in web2. Using only one Wayfinder call, I do not think you can place the menu title of a child under a different Parent (Context) in the menu.

            &sortBy=`publishedon` &sortOrder=`asc` Even this (Time of publishing) does not work cross Contexts; i.e, if you change the value of Shop's publish date to become prior to that of Contact etc. Shop will still remain in front of Contact, if the Context it belongs to is also in front of the Context Contact belongs to.

            Wayfinder seems to always sort Contexts as they appear in the Tree. Somebody please correct me.

            To cheat the system and still prosper, you could create a Weblink (preferred to Symlink) to Shop. Place the Weblink in the same Context as Contact (web1) and sort it out there; place it before the Contact Resource, in the Tree. Of course you would hide Shop's original Title from the Menu.

            PS
            Are your Contexts pointing to different domain names (site3.com / site2.net) if they are not, you might run into problems linking across Contexts.
            Any .active CSS class you have for the menu might not work on the new Weblink when it is clicked to go to Shop.

            Any help?
              TinymceWrapper: Complete back/frontend content solution.
              Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
              5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
              • 42502
              • 12 Posts
              i'll try with one more idea.
              another context with only weblinks just for wayfinder :/

                • 43864
                • 151 Posts
                You can also build up the menu using getresources or getresourcefield.
                  • 42502
                  • 12 Posts
                  thanks guys!
                  so i have separated context with just weblinks to build menu structure i (client) want.
                  menu works great but another strange issue.

                  site_url - when i skip from one context / subdomain to another site_url variable shows default domain (no subdomain). after page refresh its fine.
                    • 42562
                    • 1,145 Posts
                    After site refresh? Did this happen once or is it ongoing?
                    Your other Contexts have their own site_url setting?
                      TinymceWrapper: Complete back/frontend content solution.
                      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                      • 42502
                      • 12 Posts
                      yes each context have set its own site_url

                      this is the site: http://www.destino.pl
                      when you enter http://www.kuba.destino.pl/
                      site_url is stet for http://www.destino.pl/
                      after refresh (F5) site_url is set to: http://www.kuba.destino.pl/

                      of course whet it's wrong each link is incorrect sad