Plugin Layout

15 views
Skip to first unread message

mdipierro

unread,
Nov 4, 2009, 12:39:54 PM11/4/09
to web2py-users
We had so much talk about plugins. Here is an example of a plug-and-
play plugin that ley you change the layout of your apps.

NO CODING NECESSARY

1) make sure you run 1.71.1 and run it it with web2py.py --upgrade=yes

2) Download:

http://web2py.com/examples/static/web2py.plugin.layout.w2p

(this is not a web2py app, this is only a plugin!)

3) Choose any of your existing apps (backup first just in case, but
should work fine)

4) Go to the bottom of the [admin][Design] page for your app and
insert the plugin.

5) Now use your app. You will see an additional menu item that says:

"change layout"

Give it a try, should be intuitive.

6) Once you choose a layout you like, edit the plugin and remove its
models and controllers. The layout will stay.

7) It would be very easy to add more layouts to this plugin.


JorgeRpo

unread,
Nov 4, 2009, 3:38:25 PM11/4/09
to web2py-users

> 4) Go to the bottom of the [admin][Design] page for your app and
> insert the plugin.


at the bottom, you mean as a 'module'?

mdipierro

unread,
Nov 4, 2009, 3:40:56 PM11/4/09
to web2py-users
No. You have not upgraded the admin interface.
Do that with

web2py.py --upgrade=yes

or manually

cd applications/admin
tar zxvf ../../admin.w2p

Since 1.70.1 there is a new plugin thing at the bottom.

JorgeRpo

unread,
Nov 4, 2009, 3:48:49 PM11/4/09
to web2py-users
I use windows and just downloaded and unzipped over the previous
version.. Shouldn't that work?
--
sig text

mdipierro

unread,
Nov 4, 2009, 3:50:54 PM11/4/09
to web2py-users
No. web2py does not automatically upgrades any of the applications
(not even admin, examples, welcome) because you may have edited them.

Massimo

JorgeRpo

unread,
Nov 4, 2009, 3:52:26 PM11/4/09
to web2py-users
Ok. now i see it. after execute

web2py --upgrade=yes
--
sig text

JorgeRpo

unread,
Nov 4, 2009, 4:17:39 PM11/4/09
to web2py-users

ok. I installed the plugin and see the 'change layout' link

when I click on it, i see:

Apply a layout to your app

barebone
emporium
golf
hotel
...revert to original

But when I click on any of these options, there is no CSS, so there is
no any layout.

mdipierro

unread,
Nov 4, 2009, 4:43:34 PM11/4/09
to web2py-users
barebone has no css. The others do. Don't you have these files:

static/plugin_layout/hotel/
static/plugin_layout/hotel/examples.html
static/plugin_layout/hotel/images/
static/plugin_layout/hotel/images/content-bg-left.png
static/plugin_layout/hotel/images/content-bg-right.png
static/plugin_layout/hotel/images/footerbg.png
static/plugin_layout/hotel/images/nav-bg-left.png
static/plugin_layout/hotel/images/nav-bg-right.png
static/plugin_layout/hotel/images/nav-bg.png
static/plugin_layout/hotel/images/titlebg.png
static/plugin_layout/hotel/readme and license.txt
static/plugin_layout/hotel/styles.css

btj

unread,
Nov 4, 2009, 11:47:02 PM11/4/09
to web2py-users
Nice. Thanks for your efforts.

Wiiboy

unread,
Nov 10, 2009, 10:55:11 PM11/10/09
to web2py-users
I just noticed: if you hit "change layout" and you're not logged in as
an Admin, it doesn't redirect you to the "change layout" page after
you log in. The isn't a ?_next= in the url.

David

unread,
Nov 23, 2009, 10:43:37 PM11/23/09
to web2py-users
Massimo,

I just got this installed and working and it's given me a few ideas
about different layouts for users.

Thank you for making this plugin.

It's very nice.

- David

On Nov 10, 9:55 pm, Wiiboy <jordon...@gmail.com> wrote:
> I just noticed: if you hit "changelayout" and you're not logged in as
> an Admin, it doesn't redirect you to the "changelayout" page after
Reply all
Reply to author
Forward
0 new messages