[Mailman-Users] Customizing template

Ben Burnett benwa at ocentrix.net
Thu Apr 26 20:26:21 CEST 2001

------- Original Copy -------
>Subject: [Mailman-Users] Customizing template
>Date: 04/26/2001 11:35 AM
>From: "adam.edgar" <edgar002 at bama.ua.edu>
>To: mailman-users at python.org

>Does anyone here know a simple way to customize the general
template for
>mailman.  I would like to add our site emblem (Alabama
Public Radio) the 
>seal and apache to the banners at the base (actually a line
below them).
>So is there a template file or is this generated by python?
(note I know 
>very little python and dont feel like hacking a great deal
of code anyway)
>Thank you
>Adam Edgar


This footer is created in the Mailman script "htmlformat.py"
at the very bottom.

I hacked this to change the layout in my company's
installation.  It was the first Python I had ever done
(although I am well versed in Perl) and it was fairly
stressless.  I just added two lines and changed two others. 
You can see the changes I made below.
(My Joydesk account sometimes adds newlines that make it
difficult to read so I have attatched the changes as well.)

...lots of code here...
# Logo constants
# These are the URLs which the image logos link to.  The
Mailman home page now
# points at the gnu.org site instead of the www.list.org
from mm_cfg import MAILMAN_URL
PYTHON_URL  = 'http://www.python.org/'
GNU_URL     = 'http://www.gnu.org/'
# added ocentrix branding
OCX_URL     = 'http://www.ocentrix.com/'
# The names of the image logo files.  These are
concatentated onto
# mm_cfg.IMAGE_LOGOS (not urljoined).
DELIVERED_BY = 'mailman.jpg'
PYTHON_POWERED = 'PythonPowered.png'
GNU_HEAD = 'gnu-head-tiny.jpg'
# added ocentrix branding
OCX_POWERED = 'powered.jpg'
def MailmanLogo():
    t = Table(border=0, width='100%')
    if mm_cfg.IMAGE_LOGOS:
        def logo(file):
            return mm_cfg.IMAGE_LOGOS + file
        mmlink = Link(MAILMAN_URL,
                      '<img src="%s" alt="Delivered by
Mailman" border=0>'
                      '<br>version %s'
                      % (logo(DELIVERED_BY),
        pylink = Link(PYTHON_URL,
                      '<img src="%s" alt="Python Powered"
border=0>' %
        gnulink = Link(GNU_URL,
                       '<img src="%s" alt="GNU\'s Not Unix"
border=0>' %
        ocxlink = Link(OCX_URL,
                       '<img src="%s" alt="Powered by
Ocentrix" border=0>' %
        text = Container(Link(MAILMAN_URL, 'Mailman home
                         Link(PYTHON_URL, 'Python home
                         Link(GNU_URL, 'GNU home page'),
                         Link(OCX_URL, 'Ocentrix home
        t.AddRow([mmlink, ocxlink])
# changed this line to apply ocentrix branding
#        t.AddRow([mmlink, pylink, gnulink, ocxlink, text])
        # use only textual links
        mmlink = Link(MAILMAN_URL,
                      'Delivered by Mailman<br>version %s' %
        pylink = Link(PYTHON_URL, 'Python Powered')
        gnulink = Link(GNU_URL, "Gnu's Not Unix")
        ocxlink = Link(OCX_URL, "Powered by Ocentrix")
        t.AddRow([mmlink, ocxlink])
# changed this line to apply ocentrix branding
#        t.AddRow([mmlink, pylink, gnulink, ocxlink])
    return t

I just slapped my companies logo into the directory with the
rest of them and it works fine.

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: footer_rebranding.txt
Type: application/octet-stream
Size: 2383 bytes
Desc: not available
Url : http://mail.python.org/pipermail/mailman-users/attachments/20010426/1f99d1ec/attachment.obj 

More information about the Mailman-Users mailing list