mharc-users

Re: Customizing the index.html page for each list?

2003-10-31 14:31:10
On Friday, October 31, 2003, at 12:22 PM, Earl Hood wrote:

On October 31, 2003 at 11:37, Richard Morse wrote:

Hi!  How do I create a different template for the index.html page for
the various archives?  This is the page that you get to after the "all
lists" page, which has the big search bar at the top and a list of all
the different months that you can look at.  I need to remove the "all
lists" link, and would like to change the look of the search part.
Also, I need to be able to customize this for each list...

Customization can only be for all top index pages.  This is done
by editing the $HTML_DIR/.PNM.head.in and $HTML_DIR/.PNM.foot.in
files (and running 'make configure' afterwards).

Per archive customization is not currently supported.

Does the following seem like it would work? I've added three variables to config.sh, one to turn on the feature, the other two to specify the file names. Then, I made the following change to web-archive:

--- web-archive     Fri Oct 31 16:17:53 2003
+++ web-archive.new Fri Oct 31 16:26:44 2003
@@ -512,6 +512,19 @@
       'LIST-NAME'  => $list,
       'LIST-DESC'  => $title,
     );
+
+    if ($config->{'USE_ARCHIVE_MAIN_TEMPLATE'}) {
+ my $temp_head_name = $config->{'ARCHIVE_MAIN_HEADER_NAME'} || '.PNM.head'; + my $temp_foot_name = $config->{'ARCHIVE_MAIN_FOOTER_NAME'} || '.PNM.foot';
+
+       if (-f "$HTML_DIR/$list/$temp_head_name") {
+          $main_header = join("/", $HTML_DIR, $list, $temp_head_name);
+       }
+       if (-f "$HTML_DIR/$list/$temp_foot_name") {
+          $main_footer = join("/", $HTML_DIR, $list, $temp_foot_name);
+       }
+    }
+
     print_template(\*INDEX, $main_header, @vars);
     print INDEX "<ul>\n";
     foreach $mon (@months) {

--- end

I freely admit that I haven't tried this -- I'm entirely guessing as to whether this is the correct way to do things...

I haven't actually put this into action -- I thought I'd ask and see if it made sense first...

Ricky

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHARC-USERS

<Prev in Thread] Current Thread [Next in Thread>