We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41101
    • 40 Posts
    Does anyone know how to do this with Discuss?

    When some links an image thus -
    This would be fine but if they link an image which is 3000px x 2000px it looks terrible.

    Ideally I need to append width="600" or something similar to the data-message img tag but I'm not sure how.

    Cheers,
      • 42046
      • 436 Posts
      I don't use Discuss but you should be able to do this with css.

      Something like:

      .dis-content img {
       max-width:600px;
      }
      
        • 41101
        • 40 Posts
        Hi Dan.

        Thanks - I don't know why I didn't think of that. I got caught up with trying to format it using one of he discuss chunks rather than styling.

        The css works a treat.

        Cheers,
        • Just keep in mind that while the CSS will adjust the size of the image as displayed in the browser, the user will still have to download that huge image. That's why something like phpthumbof or another of the image resizing snippets is used.

          Any image placeholder can be resized using phpthumbof and friends as an Output Modifier.
            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
            • 38290
            • 712 Posts
            For dynamic thumbs see phpThumbsUp rather than phpThumbOf. phpThumbOf is depreciated.
              jpdevries