MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

UserTag [noloop]



******    message to minivend-users from August Detlefsen <augustd@idiom.com>     ******

Maybe someone can make use of this UserTag I developed for displaying something only once inside of [loop] tags:

# [noloop id=X]code code code[/noloop]
#
# The [noloop] tag is intended to display a chunk of code only
# once, even though it is inside [loop] tags
#

UserTag noloop HasEndTag 1
UserTag noloop Interpolate 1
UserTag noloop Order id
UserTag noloop Routine <<EOF
sub {
        my ($id, $message) = @_;
        my $id_value = $::Safe{'scratch'}{$id};
        $id_value = 0 if (!defined($id_value));

        if ($id_value > 0) {
           return '';
        }

        # else
        $id_value++;
        $::Safe{'scratch'}{$id} = $id_value;
        return $message;

}
EOF

Let me know if you find it useful.

-August
--
mailto:augustd@idiom.com
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: