The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<HTML>
<HEAD>
<TITLE>MHonArc FAQ: Index Pages</TITLE></HEAD>
<link rel="stylesheet" type="text/css" href="../docstyles.css">
<BODY>

<!--X-NavButtons-Start-->
<table width="100%"><tr><td align="left"><nobr>[<a href="archives.html">Prev</a>]</nobr></td><td align="center" width="100%">[<a href="faq.html">TOC</a>][<a href="../mhonarc.html">Manual</a>][<a href="http://www.mhonarc.org/">Home</a>]</td><td align="right"><nobr>[<a href="msgpgs.html">Next</a>]</nobr></td></tr></table>
</p>
<!--X-NavButtons-End-->

<!-- ===================================================================== -->
<hr>
<H2><a name="indexpages">Index Pages</a></H2>

<!--X-TOC-Start-->
<ul>
<li><a href="#idxtypes">What are all the different index types?</a></li>
<li><a href="#additional">Can I have additional indexes beyond the default main and thread index?</a></li>
<li><a href="#multipage">Can I have multi-page indexes?</a></li>
<li><a href="#authorsort">Can I sort messages by author?</a></li>
<li><a href="#otherindexes">How does the OTHERINDEXES resource work?</a></li>
<li><a href="#attachments">Can I include links to message attachments on index pages?</a></li>
</ul>
<!--X-TOC-End-->

<!-- ??????????????????????????????????????????????????????????????? -->
<hr noshade size=1>
<table border=0>
<tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
<h3><b><a name="idxtypes">What are all the different index types?</a></b></h3>
</td></tr></table>

<p>MHonArc catagorizes indexes into to types:
<b>main</b> and <b>thread</b>.  <b>Main</b> covers indexes
listing messages by the following criteria:
</p>
<ul>
<li>Author
<li>Date
<li>Subject
<li>Message number
</ul>

<p>When the documentation refers to <b>main</b> index,
it refers to the index listing messages by author, date, or
subject.  Therefore, all resources. and resource variables, that
refer to the main index apply to either an author, date, or
subject index.  The type of main index is controled by
the <a href="../resources/sort.html">SORT</a>,
<a href="../resources/subsort.html">SUBSORT</a>, and
<a href="../resources/authsort.html">AUTHSORT</a>,
resources.
</p>

<p>By default, MHonArc creates a date index
and a thread index.
Author index support is available only in v2.0 and later.
</p>

<!-- ??????????????????????????????????????????????????????????????? -->
<hr noshade size=1>
<table border=0>
<tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
<h3><b><a name="additional">Can I have additional indexes beyond the default main and thread index?</a></b></h3>
</td></tr></table>

<P>Yes. In version 1.2 (or later), a resource was added called
<a href="../resources/otherindexes.html">OTHERINDEXES</a>.
<a href="../resources/otherindexes.html">OTHERINDEXES</a> allows
you to define an arbitrary number of indexes you desire. The additional
indexes may be in any format you desire.
Refer to the documentation for the usage of
<a href="../resources/otherindexes.html">OTHERINDEXES</a> (also see
"<a href="#otherindexes">How does the OTHERINDEXES resource work?</a>").
</P>

<table class="note" width="100%">
<tr valign="baseline">
<td><strong>NOTE:</strong></td>
<td width="100%"><p>
MHonArc will <strong>NOT</strong> automatically
create links to any indexes created via the
<a href="../resources/otherindexes.html">OTHERINDEXES</a> resource.
You will need to modify the relevant index and messages resources
to contain the additional links.  See the
<a href="../resources/listbegin.html">LISTBEGIN</a> and
<a href="../resources/thead.html">THEAD</a> resources.
</p>
</td>
</tr>
</table>

<!-- ??????????????????????????????????????????????????????????????? -->
<hr noshade size=1>
<table border=0>
<tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
<h3><b><a name="multipage">Can I have multi-page indexes?</a></b></h3>
</td></tr></table>

<p>Yes, in v2.0 or later.  Setting the
<a href="../resources/multipg.html">MULTIPG</a> and
<a href="../resources/idxsize.html">IDXSIZE</a> will cause
indexes to to be listed across multiple pages with
<a href="../resources/idxsize.html">IDXSIZE</a> determine
the number of messages listed per page.
</p>

<!-- ??????????????????????????????????????????????????????????????? -->
<hr noshade size=1>
<table border=0>
<tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
<h3><b><a name="authorsort">Can I sort messages by author?</a></b></h3>
</td></tr></table>

<P>Yes, with v2.0 and later.
</P>

<!-- ??????????????????????????????????????????????????????????????? -->
<hr noshade size=1>
<table border=0>
<tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
<h3><b><a name="otherindexes">How does the OTHERINDEXES resource work?</a></b></h3>
</td></tr></table>

<p>I am going to describe a basic example on how <a href="../resources/otherindexes.html">OTHERINDEXES</a> can be used.
</p>
<p>First, lets have the top resource file (call it "top.mrc") that
defines the formatting of the default 2 indexes (a main and
a thread).  Example:
</p>
<pre class="code">*** snip "top.mrc" ***
&lt;<a href="../resources/main.html">MAIN</a>&gt;
&lt;<a href="../resources/thread.html">THREAD</a>&gt;
&lt;<a href="../resources/sort.html">SORT</a>&gt;
&lt;<a href="../resources/treverse.html">NOTREVERSE</a>&gt;
&lt;<a href="../resources/reverse.html">NOREVERSE</a>&gt;
*** snip "top.mrc" ***
</pre>
<p>I may have a bunch of layout stuff, but that is not important
for this discussion.
</p>
<p>The above tells MHonArc to create a date and thread index.
I am explicit with the settings to avoid potential unknown settings
from a default resource file (ie. It is always good to be explicit,
especially when we get to otherindexes).
</p>
<p>Now, I would like to also create subject and author indexes.
In "top.mrc" I would add the following:
</p>
<pre class="code">*** snip "top.mrc" ***
&lt;<a href="../resources/otherindexes.html">OTHERINDEXES</a>&gt;
subject.mrc
author.mrc
&lt;/OTHERINDEXES&gt;
*** snip "top.mrc" ***
</pre>
<p>The filenames listed are arbitrary, but it is useful if they
imply their purpose.  Since absolute pathnames were not used,
the files will be looked for in the current working directory,
or in the archive directory.  Since the current working directory
may not be appropriate, it is usually best to put the files in
the archive directory.
</p>
<p>The following now shows the important settings for each file:
</p>
<pre class="code">*** snip "subject.mrc" ***
&lt;<a href="../resources/main.html">MAIN</a>&gt;
&lt;<a href="../resources/thread.html">NOTHREAD</a>&gt;
&lt;<a href="../resources/subsort.html">SUBSORT</a>&gt;
&lt;<a href="../resources/idxfname.html">IDXFNAME</a>&gt;
subject.html
&lt;/IDXFNAME&gt;
&lt;<a href="../resources/idxprefix.html">IDXPREFIX</a>&gt;
subject
&lt;/IDXPREFIX&gt;
&lt;<a href="../resources/reverse.html">NOREVERSE</a>&gt;
*** snip "subject.mrc" ***
</pre>
<pre class="code">*** snip "author.mrc" ***
&lt;<a href="../resources/main.html">MAIN</a>&gt;
&lt;<a href="../resources/thread.html">NOTHREAD</a>&gt;
&lt;AUTHSORT&gt;
&lt;<a href="../resources/idxfname.html">IDXFNAME</a>&gt;
author.html
&lt;/IDXFNAME&gt;
&lt;<a href="../resources/idxprefix.html">IDXPREFIX</a>&gt;
author
&lt;/IDXPREFIX&gt;
&lt;<a href="../resources/reverse.html">NOREVERSE</a>&gt;
*** snip "author.mrc" ***
</pre>
<p>Again, notice how I am being explicit.  MHonArc does not reset
resources when reading the otherindexes resource files. with one
<em>exception</em>: <a href="../resources/thread.html">THREAD</a> is shut-off.  To avoid overriding the default
index files, I must explicitly redefine <a href="../resources/idxfname.html">IDXFNAME</a> (and <a href="../resources/idxprefix.html">IDXPREFIX</a>
if <a href="../resources/multipg.html">MULTIPG</a> is active).  If I want different layouts for my
other indexes, I must explicitly define those, or they will
use what was ever set in top.mrc (or the applicable default resource setting(s)
when no explicit setting provided).
</p>
<table class="note" width="100%">
<tr valign="baseline">
<td><strong>NOTE:</strong></td>
<td width="100%"><p>
Otherindexes resource file only defines a <strong>single</strong>
index type: main or thread.  If you specify the
<a href="../resources/thread.html">THREAD</a>, a thread index will be
created and all <a href="../resources/main.html">MAIN</a> related resources are ignored.
</p>
</td>
</tr>
</table>
<p> </p>
<table class="caution" width="100%">
<tr valign="baseline">
<td><strong style="color: red;">WARNING:</strong></td>
<td width="100%"><p>
    Do <b>NOT</b> define <a href="../resources/otherindexes.html">OTHERINDEXES</a> in your otherindexes resource files.
    Also, make sure there is no self references.  If you do not heed
    these warnings, you will cause an infinite loop, and/or
    unpredictable results.
</p>
</td>
</tr>
</table>
<p>Make sure <a href="../resources/otherindexes.html">OTHERINDEXES</a> resource files are present for all
updates to an archive.  Mhonarc only stores settings for the
default indexes, so the resource files are needed each time
for other indexes.
</p>

<p>What is left out of this example is the redefinition
of navigational based resources.  Since I am adding
more indexes, I would have to redefine resources like
<a href="../resources/toplinks.html">TOPLINKS</a>,
<a href="../resources/botlinks.html">BOTLINKS</a>,
<a href="../resources/listbegin.html">LISTBEGIN</a>,
<a href="../resources/thead.html">THEAD</a>, etc, so there will be links
to the other indexes.
</p>

<!-- ??????????????????????????????????????????????????????????????? -->
<hr noshade size=1>
<table border=0>
<tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
<h3><b><a name="attachments">Can I include links to message attachments on index pages?</a></b></h3>
</td></tr></table>

<p>Not directly, but a (dirty) work-around maybe possible.
You can modify the
mhexternal.pl filter to write to a file (name based off the message
number) with some HTML markup that creates the HTML attachment list
(mhexternal.pl knows about content-types and other stuff, so it can
make a useful list).  Note, since mhexternal.pl works on a single part
at a time, it needs to create the list via append operations to the
file.  The implementation is similiar to how mhexternal.pl supports
placing attachments into a subdirectory.  Make sure that mhexternal.pl
returns the file as part of the return value so it is automatically
deleted if the message is removed from the archive.
</p>
<p>Then, you define the <a href="../resources/litemplate.html">LITEMPLATE</a>
resource to use a server-side include
to include the file as part of the message listing.  I did say
it was dirty, but it should work.
</p>

<!-- ===================================================================== -->
<hr>

<!--X-NavButtons-Start-->
<table width="100%"><tr><td align="left"><nobr>[<a href="archives.html">Prev</a>]</nobr></td><td align="center" width="100%">[<a href="faq.html">TOC</a>][<a href="../mhonarc.html">Manual</a>][<a href="http://www.mhonarc.org/">Home</a>]</td><td align="right"><nobr>[<a href="msgpgs.html">Next</a>]</nobr></td></tr></table>
</p>
<!--X-NavButtons-End-->

<HR>
<address>
$Date: 2005/05/25 19:51:01 $ <br>
<img align="top" src="monicon.png" alt="">
<a href="http://www.mhonarc.org/"
><strong>MHonArc</strong></a><br>
Copyright &#169; 1997-1999, <a href="http://www.earlhood.com/"
>Earl Hood</a>, <a href="mailto:mhonarc&#37;40mhonarc.org"
>mhonarc<!--
-->&#64;<!--
-->mhonarc.org</a><br>
</address>
</BODY>
</HTML>