Skip to content

Renand/cfwheels-FallbackImage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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-0.1.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 :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ColdFusion 100.0%