We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22466
    • 3 Posts
    Is is possible to quickly and (hopefully) easily refer to a template variable from another page? If so, what’s the syntax to do this? I’ve poked around the docs and forums but didn’t find anything.

    Thanks,
    Owen
      • 11975
      • 2,542 Posts
      Hi,

      there are several way to achieve this it depends on your aim.
      If you wish to display a single TV from another document you can use getField snippet
      You can use ditto as well

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 22466
        • 3 Posts
        Thanks for the tip.

        After looking at some examples, I tried this in a chunk for a sitewide menu:

        <li><a href="about">[[getField? &docid=`7` &field=`sectionheader`]]</a></li>

        but isn’t returning any value.

        &docid is the number to the right of the document name in the file manager, correct? and &field is the TV, I think.

        i’ll also dig into the documentation some more.

        thanks,
        owen
          • 36805
          • 354 Posts
          Quote from: owentw at Feb 14, 2007, 01:10 PM

          [...]

          <li><a href="about">[[getField? &docid=`7` &field=`sectionheader`]]</a></li>

          but isn’t returning any value.

          &docid is the number to the right of the document name in the file manager, correct? and &field is the TV, I think.

          [...]
          Yes on the first part. Partly yes on the second part: The &field can either be a TV OR a document object field
            • 22466
            • 3 Posts
            Step 1 to getting getField to work...install the getField snippet smiley

            I thought it was there by default. Oops. All is well and got what I needed. Thanks everyone.