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

    i’ve just begun to use Modx am i am quite content with this system. After beginning adding content a problem reveals itself that i can’t handle on my own.
    The Documentstructure of Modx is a tree - so any Document can only have one parent, when i have understood it correctly.

    But i have the problem that i have a Document which schould be published under different parents like:

    Persons1:
    - a
    - b
    - c

    Persons2:
    - d
    - e
    - a

    "a" in both trees schould be the same document. I have solved it for now using a internal weblink fomr Persons 2:a to Persons1:a. But this solution is not what i realy wanted, because using Breadcrumbs after using the link shows "Home >> Persons1: >> a" where should be "Home >> Persons2: >> a".

    I am realy witgout a clue what to do? Do i have to fetch the Document out of the Database using a own snippet? Or is there any easier way?
      • 9477
      • 4 Posts
      Quote from: ganeshXL at Nov 29, 2007, 11:08 AM

      Of course, any changes you make to A1 won’t be automatically synced with A2...

      Yes... that the problem. :/
        • 25663 MODX Staff
        • 12,272 Posts
        Does that work well ganeshXL? If so you could create a template consisting of nothing but a "clone source" TV and an @BINDING that pulls in everything ... but I’m not sure and have never done it that way.

        What you’re wanting to do will be in the next release on the new codebase (referred to now as 097).
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 9477
          • 4 Posts
          Quote from: ganeshXL at Nov 29, 2007, 11:33 AM

          Actually... use the @DOCUMENT binding in a template variable. Leave it blank by default, and only use it if you need to "clone" a document/person.
          http://modxcms.com/document-binding.html

          NICE ONE! That did the trick! Quite impressive! laugh

          Thank you!
            • 7231
            • 4,205 Posts
            Actually... use the @DOCUMENT binding in a template variable. Leave it blank by default, and only use it if you need to "clone" a document/person.
            http://modxcms.com/document-binding.html
            I took a look at the documentation but I don’t understand how this works for ’cloning’ another page.

            Binds the variable to a document. Where document_id is the numeric id of the document. The returned value is a string containing the content of the document.
            Exactly what content does it return?
              [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]
              • 25663 MODX Staff
              • 12,272 Posts
              I think it just returns the [*content*] field and not the rendered output of the page. Or any TV/meta information for that matter.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 7231
                • 4,205 Posts
                I think it just returns the [*content*] field and not the rendered output of the page. Or any TV/meta information for that matter.
                Is there much difference from the GetField snippet? With the snippet you can call any variable so it seems that it would be more flexible to use the snippet over @DOCUMENT. However I DO see where it could be handy as in the example on the documentation page.

                For example: We could create a document called MySideBarInfo (id:18) which will store some information to be displayed in the sidebar of our template. We could then create a simple TV called MySideBar and bind it to document 18

                By adding the [*MySideBar*] variable inside the template we’ll be able to render the content of document 18 whenever the page is displayed. This effectively gives you the ability to emulate the “blocks” concept of many other content management systems.
                  [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]
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  The code is in manager/includes/tmplvars.commands.inc.php on line 37. It might be an interesting job to make it deal with more than just the content field.
                              case "DOCUMENT" : // retrieve a document and process it's content
                                  $rs = $modx->getDocument($param);
                                  if (is_array($rs))
                                      $output = $rs['content'];
                                  else
                                      $output = "Unable to locate document $param";
                                  break;
                  
                    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
                    • 9477
                    • 4 Posts
                    Quote from: ganeshXL at Nov 29, 2007, 06:04 PM

                    Yeah, it seems that only the content field gets copied. So there would still be a bit of redundancy, because you have to update the meta infos yourself (page title, introtext, alias etc.).
                    On the other hand, people usually don’t change names on a weekly basis smiley
                    If you don’t need to keep track of thousands of employees and hundreds of teams, I guess it’s acceptable.

                    For me this solution works perfect. I realy only wanted the content to be updated. The Pagetitle etc SHOULD be different - regarding the current context.