We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25761
    • 12 Posts
    RussiansLoveRockets Reply #1, 18 years, 10 months ago
    Hi,

    I’ve got a Ditto call in a root document "locations", the call below aggregates all the child documents into one. Each child document has template variables. The root document and child have different templates, but both are allowed to access/process these variables.

    Ditto call:
    [[Ditto? &startID=`6` &tpl=`each-location` ]]


    Everything works fine when I go and see child documents, but when I go to parent, I only see default values of the TVs.

    Has anyone had a problem like this? I am new to template variables and to MODx.

    Ditto template:
    <strong>[+title+]</strong>
    [*location-photo*]
    [*location-tel*]
    [*location-addr*]
    
      • 7231
      • 4,205 Posts
      Try with [+variableName+] instead of [* *]. I have noticed that if you use [* *] you will get the value form the current document rather than from the Ditto retrieved document. I am not a Ditto expert (or any sort of expert) so I say give it a try, it might work. 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&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 25761
        • 12 Posts
        RussiansLoveRockets Reply #3, 18 years, 10 months ago
        Thanks! That fixed it all.
          • 37763
          • 12 Posts
          how i do that on modx revo?
            • 16278
            • 928 Posts
            You don't - yoiu use getResources