We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi Modxers!
    I am building my first multi-lingual site using contexts.
    All working fine, but I have a problem with some internal menus.
    I'm using PDOMenu. I'm calling a startId of 4, which is the Products Section in the first context, but in the other languages, it's blank, because the product section in context two has an id of 100.

    [[pdoMenu?
        &startId=`4`
      ... various other settings which aren't relevant to this...
    ]]
    


    Is there some code I can add in, which says 'if it's context A, then use 4, if it's context B, then use ID 100.

    Thanks as always for any help!

    Andy
      • 36818
      • 119 Posts
      Are you working with the Babel Extra?
        • 51020
        • 670 Posts
        Quote from: achterbahn at Sep 07, 2018, 11:36 AM
        Are you working with the Babel Extra?

        No I'm not - because the content of each site isn't a direct translation - so I'm just using lexicons for any common content - the rest is set up as standard resources and they are not linked to each other if that makes sense.

        Andy
          • 36818
          • 119 Posts
          Then this solution from Bob Ray could be helpful.
          https://forums.modx.com/thread/102587/pdoresources-and-context-link
            • 51020
            • 670 Posts
            Quote from: achterbahn at Sep 07, 2018, 11:43 AM
            Then this solution from Bob Ray could be helpful.
            https://forums.modx.com/thread/102587/pdoresources-and-context-link

            Thanks for this - I have seen Bob's solution when searching the forum, but this relates to the site start - but my menu is not the site start - it's a section further within the site, so I don't think it will work.

            I guess I could just comma separate the ID:

            &startId=`4,100,200,300`
            


            But not sure if that would have a performance impact when each language tries to find them all, when only one of the IDs will be present for each? Is that too hacky?

            Thanks
            Andy
              • 36818
              • 119 Posts
              You could define a parameter per context and use them.

              &startId=`[[++myStartID]]`
                • 51020
                • 670 Posts
                Quote from: achterbahn at Sep 07, 2018, 11:53 AM
                You could define a parameter per context and use them.

                &startId=`[[++myStartID]]`

                Of course - so simple!
                I will give that a go.

                Thanks
                Andy