X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2FMaypole%2Ftemplates%2Ffactory%2Fmacros;h=ddaeae1bf8e23bff911e551561a3df504fafb1d8;hb=10b05d688eb14faac62ef3cc504e6a3e51b40251;hp=8267d926de4a157445a6934dccab74163625fee3;hpb=dd369c8a18080c4f27237f23b5842d53da05f570;p=maypole.git
diff --git a/lib/Maypole/templates/factory/macros b/lib/Maypole/templates/factory/macros
index 8267d92..ddaeae1 100644
--- a/lib/Maypole/templates/factory/macros
+++ b/lib/Maypole/templates/factory/macros
@@ -10,12 +10,20 @@ system.
This creates an to a command in the Apache::MVC system by
catenating the base URL, table, command, and any arguments.
+arguments are table, command, additional, label, target.
+
+target specifies a target for the link if provided.
+
#%]
[%
-MACRO link(table, command, additional, label) BLOCK;
+MACRO link(table, command, additional, label, target) BLOCK;
SET lnk = base _ "/" _ table _ "/" _ command _ "/" _ additional;
lnk = lnk | uri ;
- '';
+ IF target ;
+ '';
+ ELSE;
+ '';
+ END;
label | html;
"";
END;
@@ -63,8 +71,7 @@ for some.
ELSIF col == classmetadata.stringify_column;
maybe_link_view(item);
ELSIF col_obj; # its a real column
- accessor = item.accessor_name_for(col_obj) ||
- item.accessor_name(col_obj); # deprecated in cdbi
+ accessor = item.accessor_name_for(col_obj) || item.accessor_name(col_obj); # deprecated in cdbi
maybe_link_view(item.$accessor);
ELSE;
item.$col;