Pulp
|
| Posted: 06/10/2003, 12:51 AM |
|
Hello there...
I'm using CCS 2.0 and PHP+templates.
I'd like to show a default image if none is present. Actually the show image is
uploads/{img}
But if {img} has no value, i'd like to show defaults/{logo} instead.
How could CCS manage to do so ? Help !
|
|
|
 |
Dark Master
|
| Posted: 06/10/2003, 1:58 AM |
|
The easiest way is to storing all your images paths in your database
image_name | image_column
-------------------------
dog | uploads/dog.gif
cat | uploads/cat.gif
snake | default/noimage.gif
Another way is adding some handle into your image control BeforeShow event
similar to code below
if( !$form_name->image_control->GetValue()
|| !file_exists($form_name->image_control->GetValue()) )
{
$employees->picture->SetValue("defaults/noimage.gif");
}
|
|
|
 |
|