[Moin-user] Moin and frames layout

Tim Bird tim at bird.org
Thu Oct 17 09:10:05 EDT 2002


bragiba at simi.is wrote:
> 
> I would like to change the layout of a moin wiki I have to be like
> 
> +----------------------------------------------------------------+
> |
> |
> |     Navigation bar                                                     |
> +----------------------------------------------------------------+
> |               |
> |
> |               |     Display frame                                      |
> | sub-     |
> |
> |  menu  |
> |
> |               |
> |
> +-----------------------------------------------------------------+
> 
> The navigation is the standard moin navigation bar.   The links in the
> navigation bar change the menu I get
> in the sub-menu frame.    Then depending on what I select in the sub-menu I
> will display that in the display frame.
> 
> Can anyone point to areas where to look to start these changes?

I have done some (interesting, IMNSHO) things with the navigation
bar.  (Unfortunately, it's not exposed anywhere yet, or I'd provide
a link).  You can do a lot without having to modify MoinMoin
itself, but I think you will probably have to do so.

Inside your moin_config.py, you can define
title1, title2, page_footer1 and page_footer2
(why these aren't orthogonally named is beyond me).

Whatever string you put in title1 is emitted before the rest of the
title that MoinMoin puts out.  title2 is emitted after the title that
MoinMoin puts out.  page_footer1 is emitted before the footer that
MoinMoin puts out, and page_footer2 after.

This yeilds quite a bit of flexibility.  For instance, you can
start a new table, and a left-hand td in title2 (with your
sub-menu) and opening td in title2, and then a closing td and
end table in page_footer2. This will get you some of what you
need, if you can do it with static text.

For example, in moin_config.py put:
title2="""<table><tr><td>
(your sub-menu stuff)
</td><td>"""
page_footer1="</td></tr></table>"

If you need to do something programatic, then the actual routines
to output the title and footer are in MoinMoin/wikiutil.py, in the
routines send_title() and send_footer() respectively.

Since you want to affect the contents of the sub-menu programmatically
(depending on the selection from the navigation bar), you will
need to modify these routines.

I have been thinking that it would be nice if MoinMoin allowed you
to define your own callback for send_title() and send_footer() in
moin_config.py, to allow complete control over these actions without
having to modify the MoinMoin base code.

Unfortunately, I haven't had time to whip up a patch yet, but maybe
in a few weeks I'll send something in.

Good luck.  If you get something working, please send a 
patch to the list so we can see how you did it.  I'd love to
see such a feature.
____________________________________________________________
Tim Bird                                 Tim Bird Consulting
Embedded Linux Consultant                1273 North 1000 East
tim at bird.org                             Orem, UT 84097




More information about the Moin-user mailing list