How to change the layout?

1,167 views
Skip to first unread message

Martin Weissenboeck

unread,
Dec 25, 2010, 7:08:04 AM12/25/10
to web...@googlegroups.com
Hi,

I have downloaded a new layout from web2py.com/layout and I want to active it.
There should be a link, but I cannot find it.

Any ideas? 
Thx, Martin

Marin Pranjic

unread,
Dec 25, 2010, 11:37:46 AM12/25/10
to web...@googlegroups.com
Download and install as a Plugin.

Martin Weissenboeck

unread,
Dec 25, 2010, 11:49:46 AM12/25/10
to web...@googlegroups.com
I have done it - now I have two layouts. But how to activate the second layout?


2010/12/25 Marin Pranjic <marin....@gmail.com>

mdipierro

unread,
Dec 25, 2010, 12:23:06 PM12/25/10
to web2py-users
When you install a layout (from http://web2py.com/layouts) as a plugin
it will overwrite your views/layout.html and it should be available
immediately. Is it not doing so?

On Dec 25, 10:49 am, Martin Weissenboeck <mweis...@gmail.com> wrote:
> I have done it - now I have two layouts. But how to activate the second
> layout?
>
> 2010/12/25 Marin Pranjic <marin.pran...@gmail.com>
>
> > Download and install as a Plugin.
>

Marin Pranjic

unread,
Dec 25, 2010, 12:25:59 PM12/25/10
to web...@googlegroups.com
Mhm, not sure. I tried installing 2 layouts, and it seems that every instalation rewrites layout.html in app/views section.

I would copy app/plugin_layouts/layout1.html and app/plugin_layouts/layout2.html and put them in /app/views/layout1.html (/app/views/layout2.html)

That is, if you want to use both layouts.

However, got error while trying to Delete layout file from app/plugin_layouts/. I'd suggest to devs to see what's wrong.

mdipierro

unread,
Dec 25, 2010, 12:47:31 PM12/25/10
to web2py-users
That is not the way to proceed.

When you install a layout the static files are under
- static/plugin_layouts/layouts/<name>
and the actual layout is under
- views/plugin_layouts/layouts/<name>.html
- views/layout.html
The two above are copies of the same file. You should not need to
rename the latter and you should not need to remove the former.
Instead you can edit the latest layout.html and replace its entire
content with

{{extend 'plugin_layouts/layouts/<name>.html'}}{{include}}

and you can choose any of the installed layouts by editing this one
file.

If you rename files in the plugin or delete them of course something
will break.

Massimo

On Dec 25, 11:25 am, Marin Pranjic <marin.pran...@gmail.com> wrote:
> Mhm, not sure. I tried installing 2 layouts, and it seems that every
> instalation rewrites layout.html in app/views section.
>
> I would copy app/plugin_layouts/layout1.html and
> app/plugin_layouts/layout2.html and put them in /app/views/layout1.html
> (/app/views/layout2.html)
>
> That is, if you want to use both layouts.
>
> However, got error while trying to Delete layout file from
> app/plugin_layouts/. I'd suggest to devs to see what's wrong.
>
> On Sat, Dec 25, 2010 at 5:49 PM, Martin Weissenboeck <mweis...@gmail.com>wrote:
>
> > I have done it - now I have two layouts. But how to activate the second
> > layout?
>
> > 2010/12/25 Marin Pranjic <marin.pran...@gmail.com>
>
> > Download and install as a Plugin.
>
Reply all
Reply to author
Forward
0 new messages