Index Page Customization

MHonArc creates an index page with links to all mail messages filtered (unless processing a single message with the -single option). MHonArc allows you to have complete customization over the appearance of the index page.


Filename

By default, the filename of the index page is "maillist.html". However, a different name may be specified with the M2H_IDXFNAME environment variable, the IDXFNAME resource element, or the -idxfname command-line option.


Title

The title of the index page is controlled by the M2H_TITLE environment variable, the TITLE resource element, or the -title command-line option. The text for the title is placed in the HTML TITLE element of the index page, and the text also occurs at the very top of the body in a H1 element.


Include Files

MHonArc allows you to include the contents of files into the index page via the header and footer resources.

The header file is specified via the M2H_HEADER environment variable, the HEADER resource element, or the -header command-line option. The contents of the header file are inserted above the message listing, and right after the H1 title element. NOTE: filename should not contain the <HTML>, <HEAD>, and <BODY> tags; these tags are automatically provided by MHonArc.

The footer file is specified via the M2H_FOOTER environment variable, the FOOTER resource element, or the -footer command-line option. The contents of the footer file are inserted after the message listing. NOTE: filename should not contain the </BODY>, and </HTML> tags; these tags are automatically provided by MHonArc.

The header and footer files allow you to incorporate search-forms, hyperlinks to other pages, or any other HTML markup you like.

It is only necessary to specify the header and/or footer files the first time you create an archive. The contents included from the header and/or footer files are preserved in any subsequent additions to the archive. Only respecify the header and/or footer files if you need to make changes to the header/footer contents.


Listing Layout

MHonArc lists messages in the order specified by the various sort options. However, you have complete control on how the message listing are formatted via the LISTBEGIN, LITEMPLATE, and LISTEND resource elements in the Resource File. These elements allow you to specify the HTML markup to use in the index page. When you define the contents for the LISTBEGIN, LITEMPLATE, and LISTEND resource elements, you may use special variables defined by MHonArc which are expanded to strings during run-time (See Resource Variables on the usage of variables).

LISTBEGIN

The LISTBEGIN resource element specifies the text to begin the message list. The text can be any valid HTML markup. Plus, MHonArc defines the following variables you may use which get expanded at run-time:

$CURDATE$
The current date and time.
$DOCURL$
The URL to MHonArc documentation.
$GMTDATE$
The current UTC/GMT date and time.
$LOCALDATE$
The current local date and time.
$NUMOFMSG$
The number of messages in the archive.
$PROG$
Name of program.
$TIDXFNAME$
Filename of the thread index page.
$VERSION$
Version number of program.
MHonArc's LISTBEGIN default value is the following:

<LISTBEGIN>
<UL>
<LI><A HREF="$TIDXFNAME$">Thread Index</A></LI>
</UL>
<HR>
<UL>
</LISTBEGIN>

If the NOTHREAD resource is set, the following is the default value:

<LISTBEGIN>
<HR>
<UL>
</LISTBEGIN>

LITEMPLATE

The LITEMPLATE resoure element defines the HTML text to represent each message list item. You may use the following variables which are expanded at runtime:

$A_ATTR$
The NAME and HREF attributes to use in an anchor to link to the archived message. The NAME attribute links the messages to the index page.
$A_HREF$
The HREF attribute to use in an anchor to link to the archived message.
$A_NAME$
The NAME attributes to use in an anchor for messages to link to the index page.
$DATE$
The date of the message.
$ICON$
The context-type sensistive icon. See Icons for information.
$ICONURL$
The URL to the context-type sensistive icon. See Icons for information.
$NUMFOLUP$
Number of follow-ups for the given message.
$FROM$
The complete text in the From: field of the message.
$FROMADDR$
The e-mail address in the From: field of the message.
$FROMNAME$
The English name of the person in the From: field of the message. If no English name is found, the username specified in the e-mail address is used.
$MSGNUM$
The message numbers assigned to the message by MHonArc.
$ORDNUM$
The current listing number of the message.
$SUBJECT$
The subject text of the message wrapped in an anchor element that hyperlinks to the message.
$SUBJECTNA$
The subject text of the message without the anchor element.

NOTE:
Do not specify $A_ATTR$, $A_NAME, and $SUBJECT$ together in the LITEMPLATE element. Since all of these variables contain the NAME atrribute. Invalid HTML will be created since multiple anchors will have the same NAME identifier.
LITEMPLATE's default value is the following:

<LITEMPLATE> 
<LI><STRONG>$SUBJECT$</STRONG> 
<UL><LI><EM>From</EM>: $FROM$</LI></UL> 
</LI> 
</LITEMPLATE> 

LISTEND

The LISTEND resource element specifies the text to use to end the message list. The text can be any valid HTML markup. LISTEND may contain the same variables as LISTBEGIN.

LISTEND's default value is the following:

<LISTEND> 
</UL> 
</LISTEND> 


Icons

MHonArc supports the ability to insert icons in the index page for each message based on the message's content-type. For example: You can have text/plain messages use a different icon than text/html messages.

Defining Icons

To specify the icons for MHonArc to use, you use the ICONS resource element in the Resource File. The format of each line in the ICONS element is as follows:

<content-type>:<URL for icon>

<content-type> represents a MIME content-type. <URL for icon> is the URL to the icon. The special content-type called "unknown" may be defined to specify the icon to use for non-recognized content-types. If unknown is not defined, the text/plain icon is used for unknown content types.

Example

<icons>
audio/basic:http://foo.org/gifs/gsound.gif
image/gif:http://foo.org/gifs/gimage.gif
image/jpeg:http://foo.org/gifs/gimage.gif
image/tiff:http://foo.org/gifs/ggraphic.gif
multipart/alternative:http://foo.org/gifs/gmulti.gif
multipart/digest:http://foo.org/gifs/gtext.gif
multipart/mixed:http://foo.org/gifs/gdoc2.gif
multipart/parallel:http://foo.org/gifs/gdoc.gif
text/richtext:http://foo.org/gifs/gdoc.gif
text/html:http://foo.org/gifs/gdoc.gif
text/plain:http://foo.org/gifs/gletter.gif
unknown:http://foo.org/gifs/gunknown.gif
video/mpeg:http://foo.org/gifs/gmovie.gif
</icons>

Using Icons

In order to incorporate icons into the index page, insert the $ICON$ variable into the LITEMPLATE resource element.

Example

<litemplate>
$ICONURL$<strong>$SUBJECT:40$</strong>
($NUMFOLUP$) <em>$FROMNAME$</em><br>
</litemplate>

The $ICON$ variable expands to the IMG HTML element with the appropriate URL in the SRC attribute to the icon. The ALT attribute of the IMG element contains the content-type of the message, surrounded by []'s, for use with text based browsers.

$ICONURL$ may also be used if you want redefine the format of the IMG element.

Example

<litemplate>
<img src="$ICONURL$" alt="* "><strong>$SUBJECT:40$</strong>
($NUMFOLUP$) <em>$FROMNAME$</em><br>
</litemplate>

This example overrides what is normally used in the ALT attribute.


Examples

Example 1

It may be easier to see how the LISTBEGIN, LITEMPLATE, LISTEND resource elements work when declared together:

<!-- This represents the default values used by MHonArc -->
<LISTBEGIN>
<UL>
<LI><A HREF="$TIDXFNAME$">Thread Index</A></LI>
</UL>
<HR>
<UL>
</LISTBEGIN>

<LITEMPLATE> 
<LI><STRONG>$SUBJECT$</STRONG> 
<UL><LI><EM>From</EM>: $FROM$</LI></UL> 
</LI> 
</LITEMPLATE> 

<LISTEND> 
</UL> 
</LISTEND> 

Example 2

Here's another example that changes the layout into a more compact listing, adds Icons usage, and adds a time stamp information on when the index page was last updated:

<listbegin>
<address>
Last update: $CURDATE$<br>
$NUMOFMSG$ messages<br>
</address>
<p>
<UL>
<LI><A HREF="$TIDXFNAME$">Thread Index</A></LI>
</UL>
<p>
Messages listed in chronological order.  Listing format is the following:
<blockquote>
<img src="http://foo.org/gifs/gletter.gif" alt="* ">
<strong>Subject</strong>
(# of follow-ups)
<em>From</em>.
</blockquote>
<p>
<hr>
</listbegin>

<litemplate>
<img src="$ICONURL$" alt="* "><strong>$SUBJECT:40$</strong>
($NUMFOLUP$) <em>$FROMNAME$</em><br>
</litemplate>

<listend>
</listend>


[Prev:Removing Messages]
[Next:Thread Index Customization]
[ToC]


MHonArc 1.1.0 -- Index Page Customization