Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

yul

macrumors newbie
Original poster
Oct 9, 2010
1
0
Hello,

I want to customize my website on iPhone. The problem is that it is
completely different on iPhone. Can you tell me what should I change in my code?

My website: http://www.openeyes.fr

Thank you,

Julien
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
There are two general approaches to formatting a site for a PDA like iPhone vs. a conventional

1) Use an iPhone template and framework and create an alternate site that way - the user agent is detected at each page load to determine which site the user sees.

Information here - read comments on that page for server side solutions

2) Through CSS create a custom stylesheet - loaded based on the user agent, the same process developers use for a "friendly print" page or accessibility device like a screen reader based on the media type. This is preferred when an existing site exists, you're not starting from scratch.

Information here - awesome looking templates, too


And finally...

Read this for the basics on PHP, user agent detection, conditional loading.

-jim
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.