Re: Site is looking fine on desktop, but mobile????
Quote:
Originally Posted by
balihr
:lamo:
Yeah, the "else" was completely useless, wasn't paying attention...
So... TheGrimReaper - here's a workaround for you to use webp, and at the same time you still get to cater those rich iphone people. :wink2: There's really no need to force them into using something else - people are slaves to habits and I'm pretty sure they will rather shop elsewhere than to be forced to use a different app, even it's maybe 50 times better... Don't let any sale escape you, no need for that. The solution above is a piece of code from includes/functions/html_output.php - you can find the file and add the code in red.
Then, simply put a matching jpg image next to your current webp images. So, if you have images/armyjeep1.webp, just manually upload another alternative image to the same folder and name it the same but with a jpg extension to have images/armyjeep1.jpg. This will let you use the
picture tag so you let the browser choose which image to display - all the good browsers will opt for the webp, and Safari will still get to use the fallback jpg and Safari users will be able to see the images. Apart from needing more disk space (which is nowadays usually not an issue), this should help you keep your webp images and keep the site fast(er), but also provide a fully working website for all Safari users.
I really like your thinking with "not letting a sale get away" it's good business sense. Quite a bit more work to capture it, but the reward may well be worth it. I have to weigh the pain, time and space expense against the gains potential, but promise I'll certainly put some mental effort into it. My wrists really ache these days, I had to get that dreadful carpal tunnel surgery back in the late 90's that I never really got back to 100% after. Gotta go soak em in cold water because the heat gets so bad., burns all the way up to my shoulders. That's a limiting factor that I really dislike immensely. Voice recognition speech to text isn't always accurate and gotta make a lot of corrections when I use big words and long sentences. Still looking for that fountain of youth.
Re: Site is looking fine on desktop, but mobile????
Quote:
Originally Posted by
davewest
Interesting use of <picture>, what about the browsers not HTML5!! They don't support webp or <picture> ether..
How about optimizing the site for IE6? Or Netscape Navigator? :wink2:
I say press F to pay respects for those not html5...
Yeah, I get your point, but I believe this is a "win some, lose some" kind of thing, and the picture tag is a well-worth balance because the win part is much greater.
I've suggested its use ONLY because OP insists on using webp, and looking at stats, there's a huge amount of people using the older Safari so they can't view webp. There's approx 5% of users still using IE and other browsers, which is significantly less than 40-ish% Safari users. So, if some old bat still using IE8 can't see pics on the site, it's a risk *I* am willing to take just to make those pics available to an iPhone 10 user... Besides, I'm pretty sure that the vast majority of people still using these obsolete browsers ARE aware that there will be many things out there not working for them, but they're using those browsers most likely for the reasons you've mentioned.
Just sharing my thoughts here, I've been wrong before (many times). :smile:
Re: Site is looking fine on desktop, but mobile????
Quote:
Originally Posted by
TheGrimReaper
How many folders deep can one go? Is it possible to do something like: images/military_vehicles/armyjeep1? This would certainly make it easier as the products come and go, thus adding years to my life.
Yes, it sure is. images/level1/level2 and create the same directory in each of the large and medium folders - images/large/level1/level2 AND images/medium/level1/level2
thus, for this example= images/military_vehicles/armyjeep1 AND images/large/armyjeep1 AND images/medium/armyjeep1 works just fine.
Re: Site is looking fine on desktop, but mobile????
CORRECTION: Make that:
images/level1/level2/level3/file
to wit:
images/military_vehicles/armyjeep1/file (for the smalls)
AND THEN
images/large/military_vehicles/armyjeep1/file
AND
images/medium/military_vehicles/armyjeep1/file
Re: Site is looking fine on desktop, but mobile????
Quote:
Originally Posted by
TheGrimReaper
How many folders deep can one go? Is it possible to do something like: images/military_vehicles/armyjeep1? This would certainly make it easier as the products come and go, thus adding years to my life.
As far as I know, as deep as many characters are allowed to make up the sub-directories and filename database field. If wanting/needing more then can increase the database field size...
Re: Site is looking fine on desktop, but mobile????
Quote:
Originally Posted by
TheGrimReaper
CORRECTION: Make that:
images/level1/level2/level3/file
to wit:
images/military_vehicles/armyjeep1/file (for the smalls)
AND THEN
images/large/military_vehicles/armyjeep1/file
AND
images/medium/military_vehicles/armyjeep1/file
In other words, I confirmed it works!