Opened 10 years ago

Closed 8 years ago

#3441 enhancement closed wontfix (wontfix)

Include "meta viewport" in DirectoryListing output to better support iPhone

Reported by: russryba Owned by:
Priority: normal Milestone:
Component: web Keywords: iPhone, iPod touch, webkit, viewport
Cc: Thijs Triemstra Branch:


When using simple mktap web to browse directories, the pages do not format well on iPhone or iPod touch.

Root Cause:
The cause of this problem is that iPhones expect a meta tag to be set to define the viewport dimensions of the device. This is part of the CSS specification that defines the size of the view window separate from the size of the page itself.

Adding a meta tag that defines the viewport appears to fix this problem. Tested locally with iPod Touch firmware 2.1.

Adding this line...

<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width"> twisted\web\woven\ fixes this problem. This was at line 26 in my version, result source code is below.

class DirectoryLister(page.Page):
    template = '''
    <title model="header"> </title>
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width" />

Searching for '<head>' I see several other places where adding this meta tag would be helpful. I know my source code is out of date so I will leave it to the developers to figure out where this should go in the latest code.

Change History (3)

comment:1 Changed 10 years ago by Jean-Paul Calderone

Summary: Change default html headers to better support iPhoneInclude "meta viewport" in DirectoryListing output to better support iPhone

comment:2 Changed 8 years ago by Thijs Triemstra

Cc: Thijs Triemstra added
Resolution: wontfix
Status: newclosed

Woven is no longer part of Twisted so closing this ticket.

comment:3 Changed 7 years ago by <automation>

Owner: jknight deleted
Note: See TracTickets for help on using tickets.