No description, website, or topics provided.
ColdFusion
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
FallbackImage.cfc
index.cfm
readme.md

readme.md

Fallback Image

This plugin resides in the view layer. It simply wraps the internal call to $imageTag. If an error occurs because the image is missing or corrupt then you have the chance to provide a fall back image to be loaded instead of giving the end user a big fat error message.

Notes

This tag does mask potential errors, but it can be very useful when dealing with user submitted content which isn't critical.

Arguments:

Takes all the normal arguments that the imageTag() takes plus one more:

fallback

  • type: string
  • required: false

The image to display if the primary image fails.

Configuration:

You can also modify which environments the fallback image will be used in, so if you want to see errors in design, but not production this is your global siwtch.

<!--- in your settings.cfm --->
<cfset application.fallbackImage.environments = "production,maintenance">

Usage Example:

<!--- in your view page --->
##imageTag( source= "avatar/user123.png", fallback= "avatar/default.png" )##

Uninstallation:

To uninstall this plugin, simply delete the /plugins/FallbackImage-*.zip file.

Credits

This plugin was created by Jordan Clark

Disclaimer

Remember that you use this at your own risk and I'm not responsible for anything. Please don't sue me :)