|
Cookbook /
FplByDaysSummary: fmt=bydays for pagelists; A custom format for YYYYMMDDHHMM format page names.
Version: 2007-03-23
Prerequisites: Last tested on pmwiki-2.2.0-beta39, however this should work with previous version.
Status: Functional; I am happy with it.
Maintainer: Feral
File: fplbydays.phpΔ
Questions answered by this recipeHow do I display a group of date/time stamped page names, well, 'pretty'? Descriptionfmt=bydays for pagelists; A custom format for YYYYMMDDHHMM format page names. This is a custom solution I desired for my listing of blog like pages that are each named with the date/time they were created on in the format To use:In your config.php, place:
// (:pagelist group={$Group} list=normal fmt=bydays:)
include_once("$FarmD/cookbook/fplbydays.php");
Usage:All you need to do is specify the format parameter of the pagelist directive as In a group which has pages with names like:
This will result in:
2007-03-22 * 2007-03-21 * A
----
^ Thursday, March 22, 2007 (2007-03-22)
12:54:AM, $Description
^ Wednesday, March 21, 2007 (2007-03-21)
7:34:PM, $Description
12:00:PM, $Description
^ A
An Example Page
With pretty colors and stuff. ;) To customize:NOTE: The naming convention is "date" to signify a YYYYMMDDHHMM style pagename, else "norm" is used;
The link style is defined by:
// Link format; we do not want underlines;
SDV($HTMLStylesFmt['fplbydays'], "
a.bydaysdate,
a.bydaysnorm
{
text-decoration:none;
}
");
Set these before you include this recipe. Say for instance:
// FPL By days:
$FPLByDaysIDateFmt = "<dd><a class=bydaysdate href='\$PageUrl'>\$TimeFromName, \$Title</a></dd>";
// (:pagelist group={$Group} list=normal fmt=bydays:)
include_once("$FarmD/cookbook/fplbydays.php");
NotesThis is based on
IF there is call for it I will endeavor to make this work with YYYYMMDD style page names as produced by PmCal and other blog like solutions, however this major point of this is to group pages by day which is rather pointless with that page naming scheme as each page IS a single day. In essence, Please tell me what you would like and I will see if I can work it in. As an aside, a handy PageVar for this style of page name:
$FmtPV['$blogpagename'] = 'strftime("%Y%m%d%H%M", time() )';
Release Notes
CommentsSee AlsoContributors
|