X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FView%2FTT.pm;h=8b12debb15be5217a95022770a064f920129e4e1;hb=ad04e7a4a8d154b90262dbc4464c3494fcb46253;hp=6f9fbc6bbc7115278c717983066e403670c7c9aa;hpb=394a7a18e5ed1231ae53c52690bd602b49328c66;p=maypole.git diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index 6f9fbc6..8b12deb 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -54,7 +54,13 @@ Maypole::View::TT - A Template Toolkit view class for Maypole ..... - [%# Template Toolkit directives and maypole macros go here %] + [% PROCESS macros %] + + [% pager %] + + [% link %] + + [% maybe_link_view %] =head1 DESCRIPTION @@ -249,13 +255,42 @@ L documentation. =head1 MAYPOLE MACROS AND FILTERS -Maypole provides a collection of useful and powerful macros...TO DO +Maypole provides a collection of useful and powerful macros in the templates/factory/macros + and other templates. These can be used in any template with [% PROCESS templatename %]. =head2 link -=head2 other macros +This creates an to a command in the Apache::MVC system by +catenating the base URL, table, command, and any arguments. + +=head2 maybe_link_view + +C takes something returned from the database - either +some ordinary data, or an object in a related class expanded by a +has-a relationship. If it is an object, it constructs a link to the view +command for that object. Otherwise, it just displays the data. + +=head2 pager -=head2 finish this documentation +This is an include template rather than a macro, and it controls the pager +display at the bottom (by default) of the factory list and search views/template. +It expects a C template argument which responds to the L interface. + +This macro is in the pager template and used as : + +[% PROCESS pager %] + +Maypole provides a pager for list and search actions, otherwise you can +provide a pager in the template using Template::Plugin::Pagination. + +[% USE pager = Pagination(objects, page.current, page.rows) %] +... +[% PROCESS pager %] + +The pager will use a the request action as the action in the url unless the +pager_action variable is set, which it will use instead if available. + +=head2 other macros =head1 AUTHOR