We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44140
    • 25 Posts
    I've been using MODX Revo and have been very impressed, but I've come across a couple of issues.

    I want to add an image in part of a page, with the image chosen when editing the resource.

    For this I created a new Template Value, named it etc and chose "Image" in the "Input Options" and the "Output Options" tabs.

    I gave my template access to it and put in the correct tag for where I want the image to appear.

    So far, so good. I was able to choose an image and it appears on the page.

    However, the only place that I can set the attributes for the <img> html tag seems to be in the TV settings. This means that if I want an alt text, then every image provided by this TV on every page will have the same alt text. The same goes for all the other tag attributes.

    I'm wondering what I've done wrong or misunderstood?
    • If you want an alt tag to accompany the specific resources image TV then you are better off creating another TV text type to be used for that purpose, just as you've done to add the image.
        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
        Visit CharlesMx.com for latest news and status updates.
      • You can use one of the resource variable tags for this, such as [[*pagetitle]].

        If you want an arbitrary alt attribute, then use MIGx. The example given in the docs show how to have several fields including an image. It's easy enough to adjust that sample to fit most reasonably simple situations. http://rtfm.modx.com/display/ADDON/MIGX

        MIGx will definitely take your MODx experience to a whole new level.
          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
          • 44140
          • 25 Posts
          Thanks for the replies. It seems a rather convoluted way to go about doing such a simple thing, though.