Results 1 to 4 of 4
  1. #1

    help question Generate images with absolute paths

    Hi guys,
    I'm creating a jQuery Mobile version of my website and have run in to a problem.
    The problem lies with JQM rather than Zen Cart but I'm more confident of getting a quick solution from you guys over here than the guys over at JQM!

    The problem I have is to do with images with relative paths. JQM isn't very good at handling them it seems, so I'm wondering how difficult it would be to change the zen_image function to generate absolute paths rather than relative?

    It would need to work in http and https mode.
    Is this something that can be done relatively easily or would it be fraught with problems?

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Generate images with absolute paths

    Quote Originally Posted by damiantaylor View Post
    The problem I have is to do with images with relative paths. JQM isn't very good at handling them it seems, so I'm wondering how difficult it would be to change the zen_image function to generate absolute paths rather than relative?
    I can't comment on the difficulty of doing this, but personally I think it is the wrong approach to the problem. Absolute paths are best avoided for many reasons, and if they are required it is best to use them only in those particular circumstances where needed.

    In your case, the best solution (IMO) would be to modify JQM rather than ZenCart. This shouldn't be too difficult, it'll just be a matter of prepending the domain name to the relative image paths available to JQM.

    Cheers
    Rod

  3. #3

    Default Re: Generate images with absolute paths

    Thanks Rod,
    My feeling was changing to absolute paths would give me a nightmare later on but I just wanted to see if anyone else agreed :)
    JQM already does prefix the path with the domain....that's the problem.....it just doesn't do a very good job of it!
    Well, it doesn't if you're re-writing your URLs with one of the mods such as Ceon URI mappping. If you re-write the URL, JQM prefixed the image path with the re-written URL rather than the true URL.

    I've been given a really easy solution though so if anyone else here tries to create a JQM site and has this problem, here's the fix.....

    Prefix the image path with a slash.

    That's it, just make your image source '/path/to/image.jpg' rather than 'path/to/image.jpg' and JQM will leave it alone.
    Easy! :)

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Generate images with absolute paths

    Quote Originally Posted by damiantaylor View Post
    I've been given a really easy solution though so if anyone else here tries to create a JQM site and has this problem, here's the fix.....

    Prefix the image path with a slash.

    That's it, just make your image source '/path/to/image.jpg' rather than 'path/to/image.jpg' and JQM will leave it alone.
    Easy! :)
    If you (or others) need a little more info as to the technical difference between the with/without slash, here's a link to one of the many tutorials.
    http://www.communitymx.com/content/a....cfm?cid=230ad

    Cheers
    Rod

 

 

Similar Threads

  1. Absolute Paths prevent facebook scraper to access the pages
    By flernebunu in forum General Questions
    Replies: 14
    Last Post: 24 Apr 2013, 01:51 PM
  2. how do I add images using absolute positioning?
    By ScottDB in forum Templates, Stylesheets, Page Layout
    Replies: 21
    Last Post: 11 Sep 2011, 09:42 AM
  3. Replies: 0
    Last Post: 3 Jan 2011, 01:40 AM
  4. Absolute image paths
    By restless in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 6 Nov 2007, 05:15 AM
  5. absolute center for category list images
    By studeo in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Jul 2007, 01:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR