With this Server Behavior you can insert a dynamic image from a recordset and if the recordset field is empty or if the image is missing you can insert an alternative image or an alternative text.
To use this server Behavion, place the cursor where you need insert the dynamic image. Open the Server Behavior from the Server Behaviors panel and specify the recordset and data column that contains the file names for the images and all the other parametrs you need use.
You can specify the Primary Image, the Alternative Image and the Alternative text. This 3 features are verified in sequence.
Specify the recordset and the data column that contains the file names for the images. You can also specify the Alt Text, the border and the Image Align.
How the Php code work:
If the Primary Image exist this image is inserted in your page.
If the Primary Image don't exists or if the recorsset field is empty I verify the Alternative Image and if this image exists this image is inserted in the page.
If the alternative image don't exixts or if you don't insert this value the Alternative Text will be insert in your page.
If also the Alternative Text is void nothig will be inserted in the page.
The last field "Thumbnails suffix" is to insert the image thumbnails (if you have). Compile this field if you need insert the Thumbnails and put this field void if you need insert the image. My code verify automatically if the suffix is before the file name or between file name and extension so you don't need specify this option. If the thumbnail don't exists the Alternative Image or the Alternative text will be inserted.
You can apply this extension more time in the same page and with a double-click on the Server Behaviors panel you can modify the parameters and re-apply the extension.