Thanks Massimo! I see that since I posted the original question the web2py
book has gained some good stuff about how to do this (or maybe I just did
not know where to find it back then...).
For anyone else who (like me) has small experience with css and web design,
I modelled by styling changes on how some of the web2py plugin layouts are
organized, with a directory:
./static/plugin_layouts/layouts/<my layout>
containing the (essentially unmodified) style sheet and images for the
custom layout.
and another directory:
./views
containing my custom layout.html edited pretty much as indicated above:
e.g:
...header
{{
response.files.append(URL('static','css/bootstrap.min.css'))
response.files.append(URL('static','css/bootstrap-responsive.min.css'))
response.files.append(URL('static','css/web2py_bootstrap.css'))
response.files.append(URL('static','css/web2py.css'))
response.files.append(URL(request.application,'static','plugin_layouts/layouts/my
layout/style.css'))
}}
body
...menu div
{{is_mobile=request.user_agent().is_mobile}}
{{if response.menu:}}
{{=MENU(response.menu, _class='mobile-menu nav' if is_mobile else
'nav',mobile=is_mobile,li_class='dropdown',ul_class='dropdown-menu')}}
{{pass}}
...everything else div
{{include}}
On Tuesday, July 10, 2012 2:07:19 AM UTC+12, Massimo Di Pierro wrote:
>
> Simply copy all your static files in static/
> Then copy your index.html into views/layout.html
> Edit layout.html and replace
> href="xyz" -> href="{{=URL('static','xyz')}}"
> src="xyz" -> src="{{=URL('static','xyz')}}"
> Edit the place where the content goes and add {{include}}
>
> Now you should have a working layout.
>
> You may want to replace the <ul class="menu">...</ul> with
> {{=MENU(response.menu)}} and add a few things like
> <div class="flash">{{=response.flash or ''}}</div>
> {{=auth.navbar()}}
> {{include 'web2py_ajax.html'}}
>
>
>
>
> On Monday, 9 July 2012 03:16:00 UTC-5, Mark Kirkwood wrote:
>>
>> I am currently developing a web application using web2py. It is at the
>> point where I want to customize the appearance to blend in with an existing
>> html/templated site that I run - so I need to understand how to customize
>> the web2py layout etc to make this happen. While there seems to be many
>> templates/styles around that I could use, there does *not* seem to be a
>> straightforward set of steps to describe how to use or adapt an existing
>> set of css styles within web2py - or have I missed something?
>>
>
--