We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44922
    • 131 Posts
    We've got a site with multiple English contexts and multiple language contexts running with Babel. It works ok except:

    Whenever a page is within a container, and you navigate to another page, the new page's URL gets added to the existing one, creating a URL which doesn't exist e.g.
    www.example.com/events is a page within a container

    Navigate from this page to news.html and you get www.example.com/events/news.html when it should be www.example.com/news.html. If you remove the container status, the page becomes www.example.com/events.html and navigation works ok. This is a pain, because all articles posts have a screwed up navigation.

    Wayfinder is discounted as the issue as we hard coded the navigation to check. Furls are enabled.

    An additional issue is that if we leave articles as a container, it won't recognise the rowTpl chunk for the container page.

    Bizarre. Can anyone help?
      • 42562
      • 1,145 Posts
      So you are using the Articles Extra?
        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.
        • 36516
        • 179 Posts
        I'm a bit confused by your description, to be honest. Can you confirm that events.htm is *in* a container, as opposed to being set as a container itself?

        Also, check the URL on that menu link in the generated HTML. Does it include the full incorrect URL, or just the end part (news.htm) that you want? And thus, is it modx generating the incorrect URL, or is the URL being altered by the browser, perhaps as a result of <base href="..."> or similar?
          • 44922
          • 131 Posts
          Dave, sorry, I may have confused myself.

          www.example.com/events IS the container, it has no ."html". The link to the page is www.example.com/events. But clicking on any link after that, even if it is not a child of the container still keeps the events/

          So, say a page aboutus.html is at www.example.com/aboutus.htm and top level, not in a container, if you are on www.example.com/events and click on the nav to go to aboutus.html then, you get www.example.com/events/aboutus.htm. Which of course doesn't exist.

          Yes, Don, we are using articles, and if you click on any individual article eg www.example.com/events/2015/09/30/new-article/ then the same behaviour happens: www.example.com/events/2015/09/30/new-article/aboutus.html.

          I'm thinking we've screwed up htaccess with Babel or else the Furls System Settings are messed up.
            • 47401
            • 295 Posts
            i think i know what the problem is. in the header you have to specify the base. articles uses base href in order to find pages. for example in the header if you havnt done already add the following line:

            <base href="[[++site_url]]" />
              • 44922
              • 131 Posts
              Comp_nerd, I believe you are indeed a genius. Many, many thanks, that's fixed it - don't know why we hadn't got that in the head, but we didn't.
                • 47401
                • 295 Posts
                Quote from: lancipoos at Oct 02, 2015, 12:49 PM
                Comp_nerd, I believe you are indeed a genius. Many, many thanks, that's fixed it - don't know why we hadn't got that in the head, but we didn't.

                ok thats great. I had a feeling it was this as I had exactly the same problem awhile ago and scratching my head for a number of hours smiley
                  • 36516
                  • 179 Posts
                  To be clear, <base> in the <head> isn't generally an absolute requirement for a webpage. I'm sure comp_nerd26 has a clearer understanding of how Article is using <base> in this case. Without specific Articles experience I'd have guessed that an incorrectly configured <base> in <head> would have been the cause of your problem, and in that case I'd have suggested removing it.

                  For example, I imagine <base href="[[~[[*id]]]]" /> would probably cause the problem you're seeing, or similar.

                  So to be clear, are you saying that Articles actually requires <base> to be used in this manner? I ask because I've had issue with <base> recently, using #tag links on a page to auto-scroll, and considered removing it to solve my problem, and staying rid of it until such a time as I found it to be necessary.

                  I noted it was included in the default template after a fresh Modx installation. Having done some research there are people who believe <base> is overused, for the wrong reasons, and on that basis it strikes me that a CMS shouldn't be generally dependent on it. But it'd be nice to know if <base href="[[++site_url]]" /> is considered a recommendation for Modx pages. I've certainly found it helpful with media sources, etc.
                    • 47401
                    • 295 Posts
                    hi dave

                    yes I find it strange that a cms system should be so dependant on base href in the head (it does say its a requirement in the support docs). ive coded many websites using different cms and of course with no cms sysmtes of which do not require this.

                    • The alternative to use the base tag is setting link_tag_scheme to abs; that will make sure links are not relative (news.html) but absolute (/news.html), which will also resolve the problem. For Wayfinder, this also needs to be set with a &scheme=`abs` property as that doesn't inherit the system setting properly.
                        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.