[Moin-user] Stripping out wiki actions

Matthew Nuzum newz at bearfruit.org
Fri Mar 14 10:05:12 EDT 2008


On Thu, Mar 13, 2008 at 11:50 PM, John Karp <johnkarp at gmail.com> wrote:
> Hi,
>
>  I'm setting up a moinmoin wiki for the first time for a small group
>  that uses the internet to coordinate. I want to set it up so that by
>  default, none of the wiki-specific actions or toolbars (except for
>  'login') is visible to people without accounts.
>
>  I know the docs give a way of making both the anon and default user
>  profiles hide those elements, but I don't want this... I only want to
>  pare things down for the anonymous; new accounts should default to
>  showing the full wikiness.

This technique involves digging into a little bit of code.

When you install Moin it puts a good portion of its code in your
site-wide python library folder. All of your globally available python
modules are there. In an Ubuntu 6.06 server I'm logged into now it's
at:
/usr/lib/python2.4/site-packages/MoinMoin/

In there you'll see a folder called theme which contains a file called
__init__.py. This file has the definition for ThemeBase that all
themes use to get their default values. See for example modern theme:

    class Theme(ThemeBase):

        name = "modern"
    ...

So basically, when you make a theme you're just taking ThemeBase and
adding your customized theme specific code/html.

Therefore the way I've taken to doing custom things is to look through
ThemeBase for the parts I want to change and then overriding them in
my theme. For example, you can override editbar to change what options
show up in the edit bar.

>  Secondly... is there a way for me to have a different header for just
>  the front page? Such as having a fancier image and no written out
>  title text? I can resort to having a static page, but I'd rather have
>  it modifiable like everything else on the site.
>

Create or install a macro that allows you to put HTML in your wiki
page (make sure to do this in a secure fashion). When you customize
your theme, have it customize the <body> tag (or some child tag) to
include a unique identifier for the page. So, you could do something
like:

 <body id="frontpage">...

This gives you the ability to create special style rules that affect
individual pages.

-- 
Matthew Nuzum
newz2000 on freenode




More information about the Moin-user mailing list