Help - Search - Members - Calendar
Full Version: MTArchiveTitle day missing? (1.4)
Movable Type Community Forum > Additional Resources > Tips and Tricks
bmk
Using %e pre-2.0 doesn't work with every server.  You can use %d, or upgrade to 2.0.  more

Brenna
bmk
Yeah, use %d or upgrade to 2.0.  Why not upgrade?  There is a lot in the new version!

Brenna
bmk
Oh, I see what you're saying.

Try this in your template, add the format= where MTEntryDate is:

CODE
<$MTEntryDate format="%B %d, %Y"$>


Brenna
Tschepsit
I'm not sure if this is a bug or if I configured the blog improperly.  Anytime I use the MTArchiveTitle parameter in reference to a specific day, the number for the day is missing in the output.  My default archive type is Individual.  MTEntryDate outputs the correct day without any trouble.
Tschepsit
Any idea how I would go about fixing this?  A quick look at the code didn't show me where the MTArchiveTitle parameter is translated from tag to text.  Does it use the %e parameter to do that somewhere?
Tschepsit
It's a long story on the upgrade - I don't mind upgrading, but I'm not the only user on this one.  In any case, I did find the spot in the code where this can be fixed.  In /lib/MT/template/Context.pm, change this:

CODE
## Archives

{...
       Daily => {
...
           section_title => sub {
               my $start =
                   start_end_day($_[1]->created_on, $_[0]->stash('blog'));
               _hdlr_date($_[0], { ts => $start, 'format' => "%B %e, %Y" });
...
       Weekly => {
...
               _hdlr_date($_[0], { ts => $start, 'format' => "%B %e, %Y" }) .
               ' - ' .
               _hdlr_date($_[0], { ts => $end, 'format' => "%B %e, %Y" });
           },
...


To this:

CODE
## Archives

{...
       Daily => {
...
           section_title => sub {
               my $start =
                   start_end_day($_[1]->created_on, $_[0]->stash('blog'));
               _hdlr_date($_[0], { ts => $start, 'format' => "%B %d, %Y" });
...
       Weekly => {
...
               _hdlr_date($_[0], { ts => $start, 'format' => "%B %d, %Y" }) .
               ' - ' .
               _hdlr_date($_[0], { ts => $end, 'format' => "%B %d, %Y" });
           },
...


I'm running MT under IIS 3 on WinNT Server.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.