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

    I have a vast image gallery.
    The gallery is set up as a bunch of collections.
    The images not only reside in the gallery, but also appear on several pages throughout the site, but are called from the same directory.

    The client frequently asks us to remove certain images from the gallery due to them being outdated.
    We then have to check through every page to see if that image appears anywhere else - but as it's a manual process, human error often prevails, and we end up with broken images.

    Does anyone have any clever ideas on how to either alert me of a broken image, or a simple way to check once it's removed?

    Thanks!

    This question has been answered by markh. See the first response.

      • 17301
      • 932 Posts
      Is the image setup as a template variable? Using the Gallery extra or modmore Gallery or some other way?

      You could try something like this in your output

      [[+image:gt=`0`:show]] 
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 51020
        • 670 Posts
        Quote from: lkfranklin at Feb 16, 2017, 11:17 AM
        Is the image setup as a template variable? Using the Gallery extra or modmore Gallery or some other way?

        You could try something like this in your output

        [[+image:gt=`0`:show]] 

        Hi - thanks or your input.
        The issue isn't with the gallery though - it's where images are used elsewhere in the site as incidental images - these are pulled in using TVs in the template.
        I just thought that I guess i could search for the image file name within the database via in phpMyAdmin - but it's obviously not a very graceful solution!
        • discuss.answer
          You could use a plugin that fires on OnPageNotFound to alert you of 404s that happen. Notify404 sends you an email, but it gets a bit spammy sometimes.. you could try adjusting it so it only notifies you of 404s on image types, sending you the referer along with it.
            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.
            • 51020
            • 670 Posts
            Quote from: markh at Feb 16, 2017, 12:31 PM
            You could use a plugin that fires on OnPageNotFound to alert you of 404s that happen. Notify404 sends you an email, but it gets a bit spammy sometimes.. you could try adjusting it so it only notifies you of 404s on image types, sending you the referer along with it.

            Sounds like plan - thanks for the steer!