We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3071
    • 99 Posts
    I’m a relative newcomer to this so really need some layman’s talk here! I have installed Modx and have managed to get the friendly URLs working, replaced my code with chunks and also hooked up all the back end CMS stuff so that I can assign different text to different divs in my site, I’m pleased with m progress! Now when I create a page it looks like this:

    www.test.co.uk/this-is-a-test

    The name of this page is of course: this-is-a-test

    But when I create the next page, i.e. the next page down in this sequence, my next page goes straight to the root URL, like this:

    www.test.co.uk/this-is-the-second-test

    Now I want this page to go after the first one, another level down, so it like this:

    www.test.co.uk/this-is-a-test/this-is-the-second-test

    I am assuming this has something to do with the parent and child thing? Please can anyone help me do this as I have no idea!! Thanks in advance for any help.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      In your Configuration, in the Friendly URLs tab, turn on "Use friendly alias path:".
        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
        • 3071
        • 99 Posts
        Hi, thanks. but how will the CMS know which pages are parents and which are children unless I ’tell it’? I’ll try it now as well of course! Thanks
          • 5340
          • 1,624 Posts
          It knows because the modx_site_content table from db has a field called parent. If parent = 0 it is a "root" document.

          If the parent = 1 it means that it has the parent with the id 1.
            • 3071
            • 99 Posts
            Only just picked back up on this! Thanks for your response but I still cannot get this to work at all! I tried adding a published page to a ’parent page’ but then when I type the address in:

            www.test.com/parent-page/child-page

            It just returns a 404 error, too much of a novice to understand why I think!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Do you have Friendly Alias Paths turned on in the site configuration? Does the site configuration specify an alias suffix (by default it will use .html)?

              Without Friendly Alias Paths, and with the default .html suffix, your URL would be
              www.test.com/child-page.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
                • 3749
                • 24,544 Posts
                You can tell everything there is to know about the parents and children just by looking in the document tree (MODx makes use of the "parent" field when it’s drawn). You can also change the parent by dragging and dropping documents or by editing them and clicking on the Resource Parent icon.

                If you have Friendly URL’s set up properly (or turned off), you don’t ever need to type a URL, just use a link tag with the id of the document you want to link to. MODx should automatically create the appropriate URL and you can see what it is.

                Here’s a link to document 12:

                <a href="[~12~]">Go to Doc 12</a>


                BTW, have you tried the Wayfinder snippet? I will create menus with links to documents automatically.

                If you put the following in your template, you’ll see a menu with links to all your pages. You can check the URLs MODx is using by hovering over them.

                [[Wayfinder? &StartId=`0`]]
                  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
                  • 3071
                  • 99 Posts
                  Hi, yes I turned those on. Basically I want to set a page so it is one level down, I also tried the Wayfinder thing as well and when it creates a link, the link points to:

                  www.example.com/1

                  a number, instead of doing this:

                  www.example.com/point-to-this-page

                  I really am confused...had the same issue when I turned breadcrumb on as well..Anyone any ideas! Happy to let someone log in and maybe have a a quick look at my settings, for an expert it maybe something simple, I’m a novice! Can get there but it could take me weeks!
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    If you don’t give the document an alias, then it will automatically use the document ID. You can also set the configuration to use the document’s page title to generate an alias.
                      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
                      • 3071
                      • 99 Posts
                      Ok! I turned on both those features in friendly urls:

                      Use friendly alias path
                      Use friendly aliases

                      Now my urls are clean BUT I have the SEO plug in disabled? I have turned it back on and things still work, the thing is I notices the URL very quickly change from a php one to my clean one when the page loads. I am wondering if my clean URLS are simple redirected from the original php URL using a 301 as I am concerned about filling a site with content if these pages aren’t the actual pages but just redirects, anyone have any idea on this one! Thanks.