We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38310
    • 23 Posts
    If their is a page named "page1" which have an variable name [*age*],and the page1 have give it a value "23",can I get the [*age*](equal "23") value from page 1 and direct use in the page 2,I don't mean to create a chunk name "tpls" then use [[Ditto? &documents=`page1` &tpl=`tpls`]] .Thanks you guys.

    This question has been answered by sottwell. See the first response.

    [ed. note: welkang last edited this post 14 years, 6 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If you mean "use a Ditto call on page 2", you can use the &parents=`1` parameter to have it get the value from page 1; then [+age+] (and any other placeholders) in your chunk tpl would return the value for page 1.

      If you are trying to present a list of profiles, whether of users or any other "people", you might want to look at WebLoginPE instead, as this provides a "list' mode. I've used it for other purposes than for users, as it provides everything you need for creating and managing profiles.
        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
        • 38310
        • 23 Posts
        You said that then [+age+] (and any other placeholders) in your chunk tpl would return the value for page 1, if there is a way that can put the age variable direct in the page2's template without create a chunk ? And can you give me some konwledge about WebLoginPE,I haven't use it untill now.
        • discuss.answer
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Then you don't want Ditto. Try getField http://modx.com/extras/package/getfield
            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
            • 38310
            • 23 Posts
            wow, Amazing plugin!! Thinks very very very much!!
            And I'm wodnering does getFiled competible with modx1.04 version ? [ed. note: welkang last edited this post 14 years, 6 months ago.]
              • 19369
              • 1,098 Posts
              Yes it is, I used getField since 1.0.2 till now.
                • 38310
                • 23 Posts
                Yeah,I had installed it, but when I wirte it like this
                [[GetField? &docid=`5` &field=`loginName`]]
                , it doesn't return the loginName variable's value ? [ed. note: welkang last edited this post 14 years, 6 months ago.]
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Where is loginName coming from? Is it a TV associated with page 5?
                    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
                    • 38310
                    • 23 Posts
                    Yes, it is. I have found the reason, because I write it in the content zone which were changed to escape character, so it doesn't work...
                      • 38310
                      • 23 Posts
                      I am confused with the Resource content,when i write some code in it ,it will be wraped with <p></p>. Can you tell me you usually use [*content*] for?