Image Don't Show on Web page

5 posts by 3 authors in: Forums > CMS Builder
Last Post: May 14, 2012   (RSS)

By wow123 - May 12, 2012

I have the web site link like this:
www.mydomain.com/inventory.php

I have changed the Upload Directory to: ../uploads/
and the Upload Folder URL to: /cmsAdmin/uploads/

The images show up in the Section Editor when I create the listing, but it will not show up on the web site: www.mydomain.com/inventory.php

It gives me this ERROR:

Record Number: 1
_link : inventory-detail.php?1
image:

Upload Url: /cmsAdmin/uploads/13.jpg

All of the input fields show up fine.

Let me know what I need to do to fix this, thanks guys!

Re: [wow123] Image Don't Show on Web page

By gkornbluth - May 13, 2012

Hi wow123,

Do you mean that the page showed images once, and now that you've changed the upload directory the page doesn't show the images?

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Image Don't Show on Web page

By wow123 - May 14, 2012

No,

the place where the image is suppose to be on the web site says this:

Record Number: 1
_link : inventory-detail.php?1
image:

Upload Url: /cmsAdmin/uploads/13.jpg


No Image shows up.
Here is the URL: http://www.seventhwing.com/inventory.php

Re: [wow123] Image Don't Show on Web page

By gkornbluth - May 14, 2012

Hi wow123,

OK, so far I’ve found a few things...

Your detail pages actually has an underscore not a dash. It’s probably mistyped in the section editor detail page URL field.

The code on your detail page is missing a < before ?php header('Content-type: text/html; charset=utf-8'); ?>

I can’t see the php code on your page, but for a link to your detail page the basic code could be something like:
<a href="<?php echo $record['_link'] ?>">the text, image or echoed field that you want to show on your page</a>

So to display an image on your list page that can be clicked on to access the detail page, the code inside your main foreach loop should be something like:

<?php foreach ($record['your_image'] as $upload): ?>
<a href="<?php echo $record[‘_link'] ?>"><img border="0" src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /></a>
<br />
Title: <?php echo $upload[‘info1'] ?>
<br />
Caption: <?php echo $upload[‘info2'] ?>
<br />
<?php endforeach; ?>


If you did not want to link the image, you could just use:

<?php foreach ($record['your_image'] as $upload): ?>
<img border="0" src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
<br />
Title: <?php echo $upload[‘info1'] ?>
<br />
Caption: <?php echo $upload[‘info2'] ?>
<br />
<?php endforeach; ?>



border="0" gets rid of the border around your images that appears in IE.

If you were using this code on a detail page, you would leave off the foreach loops and replace each occurrance of the variable $record with $your_tableRecord.

Hope that helps,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php