We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9021
    • 40 Posts
    hello,

    I’m managing a website with 4 different languages (organized in 4 sub trees), of which 1 is english. Now we need to split out this english tree into a UK part and a global part (and maybe more later on). While these trees will likely differ on some pages, still a lot of pages will contain exactly the same content (about 50).

    How would I do this? We are very concerned with SEO so we do not want different URLs for pages that are the same (because that would create duplicate content). Still, we would like pages that are different be linked to according to the website that is visited. For example if you go to www.mycompany.com/uk/ you would get a different page than when you would go to www.mycompany.com/en/, but if you click on ’software’ in either menu, you would get the same page (e.g. www.mycompany.com/en/software). After that, when you click home again, you would have to be taken to the respectively homepages. I hope this makes sense.

    I have been thinking about extending the modx core and creating a ’shadow document’ which acts as an instance of another page. These shadow documents would have to be created when the user gives a command like ’shadow copy’ instead of the usual ’copy’. Shadow copies could individually be ’instantiated’, turning them into real pages and thus allowing them to be edited. Doesn’t really fix the duplicate content problem yet though.

    I could probably pull this off but I don’t really feel like hacking modx, so what would be the events I would have to look in to?
      • 7231
      • 4,205 Posts
      I can’t help with the code, but I think that this is a great idea. I have often thought that a ’page alias’ or a ’shadow page’ would be a great effective way to have pages repeat without actually having duplicates.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 22303 MODX Staff
        • 10,725 Posts
        If I understand what you are wanting, I could see something like this being accomplished by simply creating a TV, maybe content-uk, then using a snippet (or possibly a plugin) to replace the [*content*] tag with [*content-uk*] if it contains the alternate content. Or you could use this technique consistently in all your templates by just creating a snippet to handle the process of determining whether or not to display the main content or a specific piece of shadow content, based on a session variable indicating the user’s preferred language identifier. For the manager, you could look at ManagerManager plugin to hide the main or shadow content, also based on manager user preferences, if needed.
          • 7231
          • 4,205 Posts
          What I was referring to is the ability to have the same document available in two containers. So that you could have the same document in two locations in the document tree to take advantage of the document tree based navigation (ie Wayfinder) as well as have a visual representation of the document within the tree. I currently accomplish this as you suggested but I need to have two independent documents and apply some handy work to pull the content from the original document, and this is a bit beyond the skills of my clients. With a ’shadow page’ or an ’alias’ you could simply select the locations you want the document to show up and place it there so that it will show up in the correct place in the navigation and have a centralized document for editing. And if you could do this for an entire container it would rock. I hope I was able to explain what I mean, and that this is what the original poster meant as well.

          I see this beeing used in sites with multiple languages as well as situations with product catalogs.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 22303 MODX Staff
            • 10,725 Posts
            That’s what weblinks are for, or do you mean you want duplicate content on different final URLs? If so, create a document and place a snippet in it that uses $modx->sendForward($originalDocumentId) to display the content of the forwarded page at the URL of the shadow document.
              • 7231
              • 4,205 Posts
              That's what weblinks are for, or do you mean you want duplicate content on different final URLs?  If so, create a document and place a snippet in it that uses $modx->sendForward($originalDocumentId) to display the content of the forwarded page at the URL of the shadow document.


              weblinks are a solution, but they take you to the document which will open in it’s own location so you would be taken to another location in the tree. There can also be a page that loads the data from another document, this is a better solution since you could open the document ’in-place’ rather than in it’s original location. The catch is that the ’ghost’ page needs to be set up manually and referenced to the original document and you will need to title the document etc...

              What I am dreaming about is a way to represent ’duplicate’ content in the document tree without the document being actually duplicated and have the document open according to the location that it was accessed. Thus respecting the document tree based navigation.

              For example:

              Container 1
              --> Doc 1
              --> Doc 2
              --> Doc 3
              Container 2
              --> Doc 4
              --> Alias of Doc 2
              --> Doc 5

              So if I access Doc 2 the parent will be Container 1, however if I go to the Alias of Doc 2 the parent would be Container 2. This way I only edit one document but both have independent locations (respecting the section navigation). I understand that this is not essential and can be accomplished with some snippets, however I feel that a casual user would not be able to figure this out and there is the issue of naming the document and other things that could lead to errors. Just an idea grin
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 22303 MODX Staff
                • 10,725 Posts
                Ok, just use a plugin OnPageNotFound to detect the shadow URLs by looking up the real document ID after transforming the alias (since it’s a predictable pattern, this should be easy to do) and then use $modx->sendForward($realDocumentID) if you find a match. The page will remain on the shadow URL, but show the content of the forwarded document ID, with a 200 response.
                  • 7231
                  • 4,205 Posts
                  Ok, just use a plugin OnPageNotFound to detect the shadow URLs, look up the real document ID by the transformed alias (since it’s a predictable pattern, as you suggested) and then use $modx->sendForward($realDocumentID) if you find a match. The page will remain on the shadow URL, but show the content of the forwarded document ID, with a 200 response.
                  This looks good but is a bit beyond my current modx brain capacity (have not looked at plugins yet). Thanks for taking the time to discuss this with me, much appreciated. I think that I have hijacked this thread long enough...for now.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don't know what it is.
                    Do you, Mr. Jones? - [bob dylan]