burt, on 19 January 2011, 11:25, said:
Anyone wanting to know how to add an image to a box, here is an example with correct $data;
You do not need to add an extra div class of img. Unless that is doing something else such as centering the image or such.
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_IMAGE_BOX_TITLE . '</div>' .
' <div class="ui-widget-content infoBoxContents">' . tep_image(DIR_WS_IMAGES . 'paypal.gif', 'We accept Paypal') .
' </div>' .
'</div>';
Burt I decided to give yours a go and see what happened. Installed box ok. Tried several ways for the Image.
When I tried yours.
Box title and we accept paypal shows- no image and no errors
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_PAYPAL_ACCEPTED_BOX_TITLE . '</div>' .
' <div class="ui-widget-content infoBoxContents">' . tep_image(DIR_WS_IMAGES . '/xxx/images/paypal_accepted.JPG', 'We accept Paypal') .
' </div>' .
'</div>';
This one produces image only:
$data = '<div class="img"><img src="http://xxx.com/xxx/images/paypal_accepted.JPG"></div>';
This one I thought I would have a little fun and try one my self.
It removes footer and places it in right column.
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_PAYPAL_ACCEPTED_BOX_TITLE . '</div>' .
' <div class="ui-widget-content infoBoxContents">' .
'<div class="img"><img src="http://xxx.com/xxx/images/paypal_accepted.JPG"></div>';
' </div>' .
'</div>';
Tried all of them on this thread and only one brings up the image the rest just bring up the box title and we accept paypal. There is no red x or image or errors. I am the only one that could manage to put the footer in the right Column. LOL!!!
$data = '<div class="img"><img src="http://xxx.com/xxx/images/paypal_accepted.JPG"></div>';
Thanks
Edited by badbo, 19 January 2011, 17:55.