Broken Image Paths

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 31, 2013   (RSS)

By csdesign - May 31, 2013 - edited: May 31, 2013

Hello!  I ran into an issue that I found a work around for... but really curious to know how to fix it correctly. 

I have a multiple record list of lodges.  On each lodge page there is a logo, photos, etc.  All the images are broken because they are trying to use only part of the image url. 

The code for the logo on the detail page was this:

<?php foreach ($lodge_pagesRecord['logo'] as $index => $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo htmlencode($upload['info3']) ?>" />
<?php endforeach ?>

Which resulted in broken images with the url of:   http://uploads/lodge-logos/absarokalogo_05a.gif

I modified it to this and it works, but I'd really like to know how to fix it correctly.

<?php foreach ($lodge_pagesRecord['logo'] as $index => $upload): ?>
<img src="http://www.mydomain.com/cmsAdmin/<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo htmlencode($upload['info3']) ?>" />
<?php endforeach ?>

I copied the header right from the code generator.

I've also set the Viewer Urls to: 
List Page URL: /lodges-east-yellowstone-list.php
Detail Page URL: /lodges-east-yellowstone-detail.php

Also, I'm using a slideshow that will only half work with my "work around"  (shows thumbnails but not large images) so I guess it's more of a priority than I thought.  :( 

I've attached a copy of the detail page. 

Any thoughts on why the path to the custom image directories are broken? 

Thanks! Tina

By gregThomas - May 31, 2013

Hi Tina, 

Firstly I would check the general settings area of your CMS and check that the uploads folder URL doesn't have two trailing slashes on it like this:

//uploads/

As this would cause the same error you're reporting. 

Also, I noticed that the site that's using this page looks to have htaccess rules that are rewriting the detail pages to look like .html pages, could it be an htaccess rule that is causing the issue?

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com