We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18253
    • 34 Posts
    Hello everyone,

    I am interested in using what I think would be a template variable ( TV ) for changing the image that is displayed on my upper left hand corner of www.haztufiesta.com . I will in essence be attempting to have MODx on the "TV fly" modify:

      <div id="topleft"><img src="images/san-carlos-bay.jpg" alt="San Carlos Bay" width="220" height="200" class="bigpic"></div>


    Specifically:
    <img src="images/san-carlos-bay.jpg" and maybe even the tag alt="San Carlos Bay"

    This would be a way of simply going back in and adjusting individual page variables so as to assign unique images per page. Am I on the right track? I am unsure how to proceed and would like to devise something to the effect without having to reproduce templates. I will keep the same width="220" height="200" and will probably even like to have a directory like /images/topleft/ contain these different images in that I can select to customize the created template. Autoreading the directory would be cool, is MODx capable of that as well?

    Gracias,
    Marco, the Mexican MODx Fan !
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes, if you use a TV with the input type of Image and the output widget also Image, you’ll be able to select the desired image for each page, and will be presented with a file upload field as well so that you can upload the image if it’s not already on your site.
        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
        • 18253
        • 34 Posts
        Great ! I was wondering how the alternate text could be set per image. Is there a way to make this field available after or while you select your image?

          • 28042 ☆ A M B ☆
          • 24,524 Posts
          It’s a TV. It will be available as a TV form field when editing a document that uses the template(s) the TV has been assigned to. Just put the TV tags wherever you want the image displayed, either in the template or in the content of the document itself.
            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
            • 18253
            • 34 Posts
            Yeah, I got that part but was referring to the part on the widget that allows you to specify:

            for example the class that the image will have. Or as in this case, admin removed image behind password protected directory On the image widget in the TV setup, I saw it had a field for Alternative Text (alt) field available. If I were to set the Alternative Text here it would apply the text to all images using that TV, hence the same description for varying images. The idea would be to assign alt text per image.

            Is there a way that the Alternative Text field could somehow appear within the FCKeditor? or as simple text field below the image upload field?
              • 36592
              • 970 Posts
              You can use another TV(Text) for alt property.
              Just make [*AlternatePropertyValue*] and put it in the setting of Imgae TV.
                • 18253
                • 34 Posts
                Wow, that easy !!

                Thanks a bunch tkfm.

                I was beginning to wonder why it wasn’t possible but was just reminded just how common sense powerful MODx really is.