We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    fourroses666 Reply #1, 13 years ago
    <a class="hide fancybox" rel="gallery-c" href="[[getField? &docid=`27` &field=`my-tv`]]">[[getField? &docid=`27` &field=`my-tv`]]</a>


    This isn't working because its not looking in docid 27:
    [*my-tv:is=``:then=``:else=`[[getField? &docid=`27` &field=`my-tv`]]`*]


    Is the a simple solution for this?
      Evolution user, I like the back-end speed and simplicity smiley
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If that phx is in a tpl for getField, then you need to use [+my-tv+], otherwise you're looking for the value of the my_tv TV for the current resource, not the one getField is fetching from.
        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
        • 9995
        • 1,613 Posts
        fourroses666 Reply #3, 13 years ago
        thanks for looking for a solution

        tpl doesn't work, when i do this test:[[getField? &docid=`29` &tpl=`test`]]
        and test chunk is [+longtitle+] or any other field it shows the pagetitle.
        looking in the code of getField i don't see any &tpl function

          Evolution user, I like the back-end speed and simplicity smiley
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Hm. Been a while since I used phx. I think you'll have to do something like this - embedding the snippet in phx tags. Not sure if this works, but it should be something like it.
          [+phx:if=`[[getField? &docid=`29` &field=`my_tv`]]`:ne=``:then=`[[getField? &docid=`29` &field=`my_tv`]]` +]
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Personally, I would hack getField to have an option to put its output into a placeholder.
              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
              • 9995
              • 1,613 Posts
              fourroses666 Reply #6, 13 years ago
              That phx example works great, thanks Susan. That one didn't cross my mind.
              Because of the empty href tag my page was looking for nothing and did real bad performance.

              Thats solved now :-D
                Evolution user, I like the back-end speed and simplicity smiley