bas60
Posts: 18
|
Posted: 10/30/2011, 1:55 AM |
|
I have an Image of a page with a border around the image
If the image does not exist I don't want to show anything
Since the image needs to have a border I can't use an image like blank.gif - being 1px by 1 px transparent image.
I think I need to conditionally leave out the image object
Can anyone point me in the right direction??
|
|
|
Gena
Posts: 591
|
Posted: 10/30/2011, 6:27 AM |
|
put Panel over your image, then check and Hide/Show this panel
_________________
Gena |
|
|
datadoit
|
Posted: 10/30/2011, 8:17 AM |
|
You could also set the visibility of your image to Dynamic. Then it
becomes a programmable component.
I wish the IDE would do this automatically for images, similar to how
it's done automatically for image links.
|
|
|
bas60
Posts: 18
|
Posted: 10/31/2011, 5:16 AM |
|
how do I make the control dynamic??
This is what I have at the moment on ppage before
global $ppage;
if ($ppage->image1->GetValue() =="") $ppage->image1->Visible = false;
if ($ppage->image1->GetValue() !="") $ppage->image1->Visible = true;
|
|
|
datadoit
|
Posted: 10/31/2011, 6:01 AM |
|
From Design or HTML view, choose your image control. In the Properties
panel, under the Data tab, set Visible to Dynamic. That will put this
around your control in the HTML:
<!-- BEGIN Image Image1 --> ... <!-- END Image Image1 -->
Now you have access to that as it's own component (object oriented
programming - it's now an object).
Choose your new image component, go to Properties -> Events, and for the
Before Show, choose Add Action, choose Hide/Show Component, and set
these properties:
Component Name: Image1 (choose your image component from the listbox)
Action: Hide
Condition Type: Expression
Condition: !$Component->GetValue()
That will hide the object if it has no value.
|
|
|
|