We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25273
    • 13 Posts
    I’m not a Modx guru, so I am struggling with some work I’m undertaking on a Modx site.

    I am creating a new webpage template and I want to include a placeholder for a variable picture -
    i.e. for each new page that I create I want to display a different picture in the placeholder.

    I think I need to include a template variable to do this. But, I can’t work out how it all fits together.
    And, I can’t find any documentation that tells me what I want (It’s been a long day...)

    Can anyone point me in the right direction?

    Cheers!
      • 4971
      • 964 Posts
      You creata a template, and then you create a TV (in your case a TV with image input type),
      then you HAVE to attach the TV to the template.

      Now when you create a document/resource, you choose your template and the TV appears in
      the TV tab for you or your client to fill...

      If you need more basic info & tutorials, feel free to go to the website in my signature.
        Website: www.mercologia.com
        MODX Revo Tutorials:  www.modxperience.com

        MODX Professional Partner
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        Elements -> Template variables -> Choose the image input type. Like said (^), make sure to tick the right template you want the TV to show up on.

        Then edit your template, and where you want the image to show up, use the TV value in your <img> tag.

        <img src="[[*tvname]]">

        or in Evolution
        <img src="[*tvname*]">
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 25273
          • 13 Posts
          Mark H. and Charliez, many thanks for your replys.

          I’ve been away for a week, but had the chance to look at this again today. With your guidance, I have now set up the appropriate TV grin

          Charliez, I’ve bookmarked your website for future reference.