We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    If you use multiple domains or sud-domains with separate Contexts, you can have Resources with the same URI. But you can never have a Resource with the same URI in a single Context. The site_url + URI for a Resource must be unique in order to route requests to a specific Resource; if it pointed to multiple Resources how would you get to any others? Perhaps you want a WebLink, which 301 redirects to the target location you specify, not a SymLink—Wayfinder can display the actual target URL.
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      @tohoeg: yes, any resource page will have a unique URL (some weird caveats apply here, but let's ignore those for simplicity). Think of a content management system as a program that maps a URL to a bit of content: user navigates to somesite.com/some/page and that resolves to some resource in the manager. If that URL maps to 2 or more different resources, how would MODx possibly know which content should be displayed? Can you see the problem if you try to associate multiple resources with the same URL?

      Re your question of menus, you can have the same page appear in any number of menus, even automatically generated ones. It's more or less the same type of behavior in any number of CMS's. It all comes down to how you build your menus (e.g. using Wayfinder, or even doing a static menu coded directly into your HTML templates).

      What did stick out from your comment was the "the same resource with different parents" bit... THAT doesn't make sense. In a hierarchical structure, a resource can have only ONE parent, not different parents. A resource can't live in 2 places at once -- it can't be in one folder AND in another folder at the same time. Make sense?
        • 32316
        • 387 Posts
        While this is true
        What did stick out from your comment was the "the same resource with different parents" bit... THAT doesn't make sense. In a hierarchical structure, a resource can have only ONE parent, not different parents. A resource can't live in 2 places at once -- it can't be in one folder AND in another folder at the same time. Make sense?


        There ARE times when a resource does 'belong to multiple parents' and MODX takes care of this with a Symlink.

        An example - A running site with multiple pages for several races - each race page would have children pages for application forms, results, the race director, and so on. Now consider that a race director might run, that is direct several races so his bio, contact info in sense belongs to multiple parent race pages.
        Using Symlinks you could get runningclub.org/race1/director and runningclub.org/race2/director to point to the same resource - and the resource could live anywhere in the modx tree - say under directors so you could also read about our director (whose name is Jim Bob) at this URL runningclub.org/directors/jimbob
        Thus we have three URLs pointing to the same content

        One URL pointing to multiple resources makes less sense - how does the system know which to display?
        Well I can think of a possibility - the system just randomly chooses and this could be a valid solution at times, for example a photography site and the home page displays a random photo when the site is loaded.

        Now while the rambling post above is tangential to the original post it is somewhat off topic - the original post was talking about multiple resources being given the same alias and having the parent. I am sure that with revo 2.1.3 the cms enforces unique aliases if the two resources have the same parent (it does not allow you to save and tells you that there is already a resource with the alias) maybe 2.06 does not. Also I'm not sure what happens if you create a resource with one parent and then move it to another parent who already has a child with the same alias. Sometimes the users must be educated! [ed. note: whistlemaker last edited this post 14 years, 10 months ago.]
          • 37667
          • 18 Posts
          It appears Weblink is my best option. But unfortunately, breadcrumbs will not show the menu path of the Weblink but rather the path of the original resource.

          For example, an automotive website may want to have a resource for Toyota trucks, but there are 2 logical menu structures for that resource. One is to have a truck menu that then goes down to Toyotas and the other menu structure is to have a Toyota menu that has cars, trucks, SUV's, etc. And I'd prefer that both of those menus would lead to the same page with the same URL so that my site doesn't have pages with duplicate content. But using the Weblink, the breadcrumbs will necessarily take the file path to the actual resource even though you're accessing that page through the Weblink.

          Is there anyway to overcome this issue so that when using a Weblink, the breadcrumb path won't default to the actual resource path?
            • 22303 MODX Staff
            • 10,725 Posts
            You are creating multi-faceted navigation into reusable data. Instead of creating Resources that represent your items, you should have that data stored in a custom table structure and use MODX Resources to create the multi-faceted views into that data. Otherwise, you are trying to build multiple paths to your vehicles as Resources that are intended to represent unique controllers and views in a hierarchical site structure, not unique pieces of reusable data.
              • 37667
              • 18 Posts
              How would you envision the custom table structure? And can you elaborate in more detail on how to use MODX Resources to create the multi-faceted views? Or direct me to documentation about this.

              Btw - Read up on Contexts which answered my questions on how to set up multiple sites with one MODX install. All I can say is WOW! [ed. note: tahoeg last edited this post 14 years, 10 months ago.]