field — quickly retrieve field from Products database
Attribute | Pos. | Req. | Default | Description |
---|---|---|---|---|
name | column | col | field | Yes | Yes | ||
code | row | Yes | Yes | ||
interpolate | 0 | interpolate output? | ||
hide | 0 | Hide the tag return value? |
The tag conveniently retrieves the field from the databases listed
under ProductFiles
.
It will return the first entry found in the series of product databases,
so if you are only looking for a specific table, better use the generic
[data]
tag.
If you only have one ProductFiles
database — products, then [field
is, of course, the same as column
key
][data products
.
column
key
]
Interchange 5.9.0:
Source: code/SystemTag/field.coretag
Lines: 18
# Copyright 2002-2007 Interchange Development Group and others # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. See the LICENSE file for details. # # $Id: field.coretag,v 1.4 2007-03-30 23:40:49 pajamian Exp $ UserTag field Order name code UserTag field attrAlias column name UserTag field attrAlias col name UserTag field attrAlias row code UserTag field attrAlias field name UserTag field attrAlias key code UserTag field PosNumber 2 UserTag field Version $Revision: 1.4 $ UserTag field MapRoutine Vend::Data::product_field
Source: lib/Vend/Data.pm
Lines: 370
sub product_field { my ($field_name, $code, $base) = @_; #::logDebug("product_field: name=$field_name code=$code base=$base"); return database_field($Vend::OnlyProducts, $code, $field_name) if $Vend::OnlyProducts; #::logDebug("product_field: onlyproducts=$Vend::OnlyProducts"); my ($db); $db = product_code_exists_ref($code, $base || undef) or return ''; #::logDebug("product_field: exists db=$db"); return "" unless defined $db->test_column($field_name); return $db->field($code, $field_name); }