-[% MACRO maybe_link_view(object) BLOCK;
- IF object.moniker; # It's an object, i.e. a has-a
- "<A HREF='" _ base _ object.moniker _ "/view/" _ object.id _"'>";
- object;
- "</A>";
+[%#
+
+=head1 MACROS
+
+These are some default macros which are used by various templates in the
+system.
+
+=head2 link
+
+This creates an <A HREF="... to a command in the Apache::MVC system by
+catenating the base URL, table, command, and any arguments.
+
+#%]
+[%
+MACRO link(table, command, additional, label) BLOCK;
+ '<A HREF="' _ base _ table _ "/" _ command _ "/" _ additional _ '">';
+ label;
+ "</A>";
+END;
+%]
+
+[%#
+
+=head2 maybe_link_view
+
+C<maybe_link_view> 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.
+
+#%]
+
+[%
+
+MACRO maybe_link_view(object) BLOCK;
+ IF object.table; # It's an object, i.e. a has-a
+ link(object.table, "view", object.id, object);