Jump to content


Photo
- - - - -

Image Path Broken in Shopping Cart


  • Please log in to reply
6 replies to this topic

#1 kenlyle

kenlyle

    Member

  • Members
  • PipPip
  • 13 posts

Posted 30 June 2007 - 02:58 PM

Hi. I created a template, which *seems* to be working OK, but there is some code in the Shopping Cart page that is bringing in a path variable of some kind, and breaking the display of my header images, like this:
http://jenniferunlim...m/gr/4-Left.gif

See the issue at http://jenniferunlim...rt.php?browse=1

Any help is appreciated.

Best,
Ken

#2 NST Inc Designer

NST Inc Designer

    Senior Member

  • Moderators
  • 210 posts

Posted 01 July 2007 - 12:30 AM

This is your problem:

<img src="../template/http://jenniferunlimited.com/gr/4_Right.gif" width="359" height="100">

The source path is incorrect. The "../template/" needs to be removed. Technically these images should be placed in your template folder anyways. Something like this:

sohoadmin/program/modules/site_templates/pages/Custom-Jennifer_Unlimited-Brown[COLOR="Red"]/images/4_Right.gif[/COLOR]

Soholaunch Templates by tim burroughs

#3 kenlyle

kenlyle

    Member

  • Members
  • PipPip
  • 13 posts

Posted 01 July 2007 - 12:58 AM

Yeah, I know that's the symptom, actually, but I am having trouble locating the cause. I don't know the cascade of files that produces the final page, and since it only happens in the shopping cart, there must be something unique to the cart, and maybe it's the start.php file...

OK, I have FileMin, so I can search across the entire directory. It looks like there is a client_files/shopping_cart/pgm-template_builder.php...around lines 739 and 740 may be the spurious /template/, nope, it's not that one - removing the first ../template/ doesn't seem to change anything, the images are still broken...

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// If Not a Custom Template, Make Sure all Template Images are pulled from Template
// since they will be moved there when base template is selected.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

if ($CustomFlag == 0) {
$template_line[$xedusvar] = eregi_replace("img src=\"", "img src=\"../template/", $template_line[$xedusvar]);
$template_line[$xedusvar] = eregi_replace("background=\"", "background=\"../template/", $template_line[$xedusvar]);
}

It has to be something unique to the shopping cart directory or function......

SOLUTION: Put the images in the right place to begin with, and make the template point to them, and then don't do stupid things like renaming the template folder like I did.

Ken

#4 soholover87

soholover87

    Member

  • Members
  • PipPip
  • 18 posts

Posted 21 April 2009 - 03:29 AM

Isnt there a better solution to this. Rather than keeping the images in the template folder, what if I want the images from the 'image' folder to appear as the header? Is it never possible?

Desperate for help...

#5 naveenk87

naveenk87

    Member

  • Members
  • PipPip
  • 25 posts

Posted 21 April 2009 - 07:15 AM

There is a method to insert images from the image-folder into the header-image...
Instead of <img src use this :

$image="full-image-path";
if($size = getimagesize($image))
{
echo "<div style=\"background-image:url('full-image-path');background-repeat: repeat-none; width:$size[0]px; height:$size[1]px;\"> </div>";
}


If there is a better method pls post it....
Thnks

#6 lwyau

lwyau

    a soho enthusiast

  • Moderators
  • 5,605 posts

Posted 21 April 2009 - 10:54 AM

It is best of keep all components (including images) of a template in its folder. This makes the template self-contained and portable.

The best solution is to include a default header image in the template folder, but make it swappable with an image from the "images" folder. Read here: http://wiki.soholaun...tes#User_Images

#7 naveenk87

naveenk87

    Member

  • Members
  • PipPip
  • 25 posts

Posted 23 April 2009 - 04:29 AM

I just found out a way to use img tag itself for header images...
Like kenlyle mentioned, the reason for the error is
img src=\"
is replaceed by
img src=\"../template/

so just use
img alt=\"\" src=\"


and it works!!!:cool:

Edited by naveenk87, 25 April 2009 - 02:23 AM.
clarity





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users