We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33166
    • 9 Posts
    Hi All,

    my question is how do we assign a different value to the a TV in each document(supposed to be for the img src values)?
    what is the currect syntax for that?

    Thank you,
    Jo.
      • 16183
      • 1,390 Posts
      Jo,

      First, welcome to MODx! You’ve made the right decision smiley

      I assume you are on MODx evolution, right?

      Now to your question, I’m not quite sure I get you but you seem to be asking how different documents can be assigned a different TV value, specifically an image TV?

      1. Have you created the image TV and assigned it to a particular template?

      2. Are you documents using that template?

      If the answer is yes to both 1 & 2 above, all you have to do is click on the button (insert) beside the image TV while editing the documents and select and image. MODx will deal with the paths.

      For each document, the image you selected will appear where you chose for it to appear, i.e. where you placed the image TV placeholder (e.g. <img src="[*menutv*]"/>). I hope this makes sense. Feel free to ask more questions.

      Hope this helps laugh

      cheers/k

      EDIT: corrected img tag code + corrected TV syntax

      NOTE: If used in WF the TV is called thus: [+TVName+]. If outside WF, it is called [*TVName*]
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Make sure you’ve chosen an input type of "Image" when you created the 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