Changeset 2334

Show
Ignore:
Timestamp:
05/14/08 23:35:43 (6 months ago)
Author:
bchoate
Message:

Apply variables appropriate for archive type when previewing archive templates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-38/lib/MT/CMS/Template.pm

    r2330 r2334  
    802802        $archive_file = File::Spec->catfile( $blog_path, $obj->archive_file ); 
    803803        $archive_url = $obj->archive_url; 
     804 
     805        my $archiver = MT->publisher->archiver( $ctx->{current_archive_type} ); 
     806        my $tparams = $archiver->template_params; 
     807        if ($tparams) { 
     808            $ctx->var( $_, $tparams->{$_} ) for keys %$tparams; 
     809        } 
    804810    } elsif ($type eq 'archive') { 
    805811        # some variety of archive template 
     
    812818        $ctx->{current_archive_type} = $map->archive_type; 
    813819        my $archiver = MT->publisher->archiver( $map->archive_type ); 
     820        my $tparams = $archiver->template_params; 
     821        if ($tparams) { 
     822            $ctx->var( $_, $tparams->{$_} ) for keys %$tparams; 
     823        } 
    814824        my @entries = create_preview_content($app, $blog, $archiver->entry_class, 10); 
    815825        if ($archiver->date_based) {