Help - Search - Members - Calendar
Full Version: Custom Template Paths Format Strings
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
iki
Using strftime to create a custom path for a template.

My individual archives go here: yyyy/mm/entry_basename.php

I created a new archive template linked to the individual archives for a printable version. I want the printable version to reside next to the regular version in the archive directory, using the name print_<$MTEntryID pad="1"$>.php for each one.

QUOTE
%y - year as a decimal number without a century (range 00 to 99)
%Y - year as a decimal number including the century


So I should be able to duplicate the indi archive path using strftime:
CODE
%Y/%m/print_<$MTEntryID pad="1"$>.php


but that produces "07/04/print_000030.php" for a path. If I use the small "y" I get the 4 digit year, and the capital "Y" yields the 2 digit year - opposite of strftime.

Is this a bug, or are you not using strftime anymore?
shelley
There's a bit of an inconsistency between the Archive File Path Specifiers and the Date Formats in Movable Type:

For Archive File Paths:

QUOTE
* %y 4-digit year. Example: 2005
* %Y 2-digit year with zero-padding. Example: 05


For Date Formats:

QUOTE
* %y The two-digit year padded with a leading zero if applicable. Example: 01.
* %Y The four-digit year. Example: 2001.


So, yes, they're opposite of each other. smile.gif
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-2008 Invision Power Services, Inc.