[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] documentation request for [error] tag
****** message to minivend-users from Mike Heins <mikeh@minivend.com> ******
Quoting Bill Randle (billr@exgate.tek.com):
>
I couldn't have done better myself, in fact I would have probably done
worse, knowing my reputation. 8-)
Assuming it is OK for me to steal this and put it in the docs, I will
add this intro at the beginning:
The [error ...] tag is designed to manage form variable checking
for the Minivend C<submit> form processing action. It works in
conjunction with the definition set in C<mv_order_profile>, and can
generate error messages in any format you desire.
If the variable in question passes order profile checking, it will
output a label, by default B<bold> text if the item is required,
or normal text if not (controlled by the <require> parameter. If
the variable fails one or more order checks, the error message
will be substituted into a template and the error cleared from
the user's session.
(Below is as of 4.03, the equivalent in 4.02 is
[if type=explicit compare="[error all=1 keep=1]"] ... [/if].)
To check errors without clearing them, you can use the idiom:
[if errors]
<FONT SIZE="+1" COLOR=RED>
There were errors in your form submission.
</FONT>
<BLOCKQUOTE>
[error all=1 show_error=1 joiner="<BR>"]
</BLOCKQUOTE>
[/if]
>
> How about this, from looking at tag_error():
> [error var options]
> var is the error name, e.g. "session"
>
> The options are:
> all=1
> display all error messages, not just the one
> refered to by <var>. The default is only display
> the error message assigned to <var>.
>
> text=<optional string to embed the error message(s) in>
> place a "%s" somewhere in 'text' do mark where
> you want the error message placed, otherwise it's
> appended on the end. This option also implies
> show_error.
>
> joiner=<char>
> character used to join multiple error messages
> default is '\n'
>
> keep=1
> keep=1 means don't delete the error messages after
> copy; anything else deletes them.
>
> show_var=1
> show_var=1 means include the variable relating to the
> error message as part of the error message (E.g.:
> "email: not a valid email address".)
>
> show_error=1
> show_error=1 means return the error message text;
> otherwise just the number of errors found is returned.
>
> std_label=<label string for error message>
> used with 'required' to display a standardized
> error format. The HTML formating can bet set
> via the global variable MV_ERROR_STD_LABEL with
> the default being:
> <FONT COLOR=RED>label_str <<SMALL><I>(%s)</I></SMALL></FONT>
> where <label_str> is what you set std_label to and %s
> is substituted with the error message. This option
> can not be used with the text= option.
>
> required=<required str>
> used with std_label to specify HTML formatting for the
> label_str when no errors were found. The default format
> is <B>label_str</B>.
> For example, if you set std_label="email" and
> required="###" you would see
> ### email ###
> displayed if there were no errors, or in the case of
> an error, you would see:
> email (not a valid email address)
> in red with the part in parens in small italics.
> It would appear from my reading of the source code
> that the problem with using HTML tags as the required
> string is that they are not closed. I.e., if you use
> required="<B><I>", the result is
> <B><I> label_str <B><I>
> rather than <B><I> label_str </B></I>
>
>
> -Bill Randle
> billr@exgate.tek.com
>
> On Mar 21, 3:09pm, Mark Stosberg wrote:
> } Subject: [mv] documentation request for [error] tag
> } ****** message to minivend-users from Mark Stosberg <mark@summersault.com>
> ******
> }
> }
> } Hello!
> }
> } I'm interested in some further documentation of the [error] tag. The
> } documentation with the distribution mentions it on these two pages:
> }
> } docindex/06.08.MML_MiniVend_Markup_Language.html
> } docindex/09.00.MINIVEND_TAG_REFERENCE.html
> }
> } But neither of these locations nor the entry in the 'tags' documentation
> } explain what any of the attributes do. In particular, I'm interested in
> } what the following 2 examples do:
> }
> } [error all=1 show_var=1 keep=1]
> } [error all=1 hide=1 comment="Clear errors"]
> }
> } I poked around the source code to see if I could discern the answer, but
> } I couldn't find it.
> }
> } Thanks for any help!
> }
> } -mark
> } --
> } <<-------------------------------------------------------------->>
> } personal website < Summersault Website Design
> } http://mark.stosberg.com/ > http://www.summersault.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
> }-- End of excerpt from Mark Stosberg
>
>
> -
> 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
>
--
Internet Robotics, 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <mikeh@minivend.com>
If you like what you're gettin', keep doin' what you're doin'. -- Hector
-
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