mike
|
| Posted: 10/15/2005, 5:02 PM |
|
I have a page which displays a variable number of page
at the moment I have simply added
image1
image2
image3
....
image10
etc..
Problem is if there are only 2 images I get a "Place holder" showing
How can I avoid this.
(data for the image is stored on the record as a path)
ie.
image/picture/image1.jpg
image/picture/image2.jpg
|
|
|
 |
Damian Hupfeld
|
| Posted: 10/16/2005, 4:15 AM |
|
Right-click on the image and select "Edit Image...", then set the "Extended
HTML" option.
global $grid;
// Write your own code here.
// Hide image if the database value for "pic" is blank
if ($grid->pic->GetValue() =="") $grid->pic->Visible = false;
if ($grid->pic->GetValue() !="") $grid->pic->Visible = true;
regards
Damian Hupfeld http://www.nexthost.com.au/services.php
|
|
|
 |
mike
|
| Posted: 10/16/2005, 4:36 AM |
|
Where do I place this ??
In the 'Code' view??
My page only has a record - no grid
Sorry just getting to learn CodeCharge and this is my very first practical
project
|
|
|
 |
Damian Hupfeld
|
| Posted: 10/16/2005, 5:47 PM |
|
You need to have a grid and you would add custom code on before show (or
before show row?).
|
|
|
 |
mike
|
| Posted: 10/17/2005, 10:10 AM |
|
I've tried this on EmpsDetail
from the EmplDir
The grid is called 'emps'
so global emps; etc
if ($emps->picture->GetValue() =="") $emps->picture->Visible = false;
if ($emps->picture->GetValue() !="") $emps->picture->Visible = true;
get an error saying
Fatal error: Call to a member function on a non-object in
/public_html/empldir/empsdetails_events.php on line 20
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 10/17/2005, 10:45 AM |
|
The same code works perfectly forme on that page.
In case you changed "global $emps" to "global emps" then that could be the problem. I'm also not sure what do you mean by "etc" since there is nothing else.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
mike
|
| Posted: 10/17/2005, 2:33 PM |
|
Cracked it.... 'photo' should have been Photo
!!!
Thanks
"peterr" <peterr@forum.codecharge> wrote in message
news:54353e3453b151@news.codecharge.com...
> The same code works perfectly forme on that page.
> In case you changed "global $emps" to "global emps" then that could be the
> problem. I'm also not sure what do you mean by "etc" since there is
nothing
> else.
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |