[Mailman-Users] <MM-Mailman-Footer> is not expanded when used insite/en/archidxfoot.html

Mark Sapiro msapiro at value.net
Sun Oct 7 04:15:40 CEST 2007


Tim Bell wrote:

>I am running mailman-2.1.9 on Solaris 10.  I want the Pipermail archive
>pages to have same footer as the other mailman pages.  This is defined by
>MailmanLogo() in Mailman/htmlformat.py via GetMailmanFooter()
>in HTMLFormatter.py.
>
>As described in the FAQ [1], I set up templates/site/en/ and I am making
>my changes there.  My change is to add the standard footer used in other
>templates:
>
>% diff ../../en/archidxfoot.html archidxfoot.html
>17a18,19
>> <MM-Mailman-Footer>
>>      <hr>
>
>When I run 'bin/arch --wipe <listname>' the pages are regenerated
>with a literal '<MM-Mailman-Footer>', and not the expanded text
>as I expected, for example in subscribe.html.  This tells me that
>my modified archidxfoot.html was discovered and read (good), but
>the expected keyword expansion did not happen.  Puzzling.


This happens because the archiver uses its own template-specific
interpolation dictionaries for its templates, and none of these
include any of the '<MM-' tags.


>Are the arch*.html files processed differently than the other templates
>such as subscribe.html?


Yes. They don't use htmlformat.py or HTMLFormatter.py at all, but even
templates that have <MM- tags may not be interpolated with other <MM-
tag values that don't appear in the unedited template.

For example, the <mm-subscribe-*> tags are only recognized on the
listinfo.html template and can't be used to put a subscribe form in a
different template without modifying the code that processes that
template.

Unfortunately, which replacements work in which templates is not
documented outside of the code itself, so the safest (although not
absolute) rule is if it isn't in the original template, it probably
won't work.


>I see the expected footer on pages generated
>from subscribe.html, and changes I make in MailmanLogo() show up.
>
>
>Thanks for any pointers, relevant doc pages, or ... - Tim Bell


If you're willing to modify the code, you can find

            d = {"lastdate": quotetime(self.lastdate),
                 "archivedate": quotetime(self.archivedate),
                 "listinfo": mlist.GetScriptURL('listinfo', absolute=1),
                 "version": self.version,
                 }

in Mailman/Archiver/HyperArch.py and add a line to make it

            d = {"lastdate": quotetime(self.lastdate),
                 "archivedate": quotetime(self.archivedate),
                 "listinfo": mlist.GetScriptURL('listinfo', absolute=1),
                 "version": self.version,
                 "mailman-footer": mlist.GetMailmanFooter(),
                 }

and then use the replacement %(mailman-footer)s in the archidxfoot.html
template. You can't use the <mm-mailman-footer> tag in the template
even if you define it in the interpolation dictionary because these
tags are processed only by an HTMLFormatter method.

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list