|> Home > Documentation > Latest documentation > Interchange tags > area|
Returns a URI for an Interchange page or form action, including the Interchange session ID and supplied arguments, as appropriate.
Tag expansion example
or similarly with positional parameters:
The area tag produces the URI to call an Interchange page, but it does not supply the surrounding <a href="..."> notation. The tag was named [area] because it was originally intended for use with client-side image maps.
The [area] tag has an alias called [href], so following three links are identical in operation:
The Interchange page name you would like to create a URI for, relative to the "pages" directory. See the PageDir local (catalog.cfg) configuration directive.
Special href values
Providing an arg value is a convenient way to pass an argument value to the target page, without using the form parameter, below. The target page will be able to retrieve the argument using either of the following tags:
For instance, if you add the following link to a page:
then you can capture the argument, on the test.html target page like this:
If set true then add ".html" to the end of the path component of the generated URI.
If this parameter is not specified then the value of the mv_add_dot_html scratchpad variable will be used.
The default is to not add ".html" to the end of the page name, although this default can be overridden by setting the "mv_add_dot_hmtl" scratchpad variable true.
If set true then add a "mv_source" parameter to the URI, along with the current "mv_source" value.
The default is to not add a "mv_source" parameter to the URI, although this default can be overridden by setting the "mv_add_source" scratchpad variable true.
This parameter allows you to encode arguments into the resulting URI. For example:
The above would generate a URI that, when followed, would order one of item number "os28044", with a size of "15oz". As mv_separate_items is true, the item would appear on a separate line in the shopping cart. No href was specified, so "process" (see ProcessPage) would be used as the link target. No mv_orderpage was specified, so Interchange would use the website's default shopping cart page. If "mv_orderpage=somepage" was specified then the next page shown, after the order submission, would be "somepage". The mv_session_id and mv_arg form values will be automatically added, whenever Interchange deems it appropriate to do so.
All normal Interchange form caveats apply: You must have an action and you must supply a page, if you don't want to go to the default, etc.
Theoretically, you can submit any form using the method shown above, though none of the included values can have newlines or trailing whitespace. If you want to do something like that you will need to create a custom UserTag.
If the "href" points at a URI that starts with a protocol specification (i.e. "http://..."), and no "form" parameter is provided, then the given URI will be returned verbatim, with no further Interchange processing taking place. The URI, in this case, will not include mv_session_id and mv_pc parameters. For example:
This is, of course, utterly pointless, and a complete waste of your valuable CPU's time.
If the "href" points at a URI that starts with a protocol specification (i.e. "http://..."), and a "form" parameter is provided, then the form variables will be appended to the href and returned without further modification.
The URI, in this case, will include any values supplied with the "form" or "arg" parameters, but will not include mv_session_id and mv_pc parameters even if the no_session or no_count attributes are explicitly unset to allow it. Also the add_dot_html and secure attributes will be ignored and .html will not be appended to the path name nor will the protocol be changed to https:// or the SecureURL configuration parameter used.
If this parameter is set true then the href path will be assumed to be relative to the current directory, and the resulting URI will be generated accordingly.
For instance, if the current page is "foo/bar.html", and you want to link to the "foo/baz.html" page then you can use either of the following two methods:
Set secure true if the current page is secure.
Don't encode a "mv_pc" argument into the generated URI.
If this parameter is not specified then the value of the mv_no_count scratchpad variable will be used.
The default is to always add a "mv_pc" argument into the generated URI, although this default can be overridden by setting the "mv_no_count" scratchpad variable true.
Never encode "mv_session_id" nor "mv_pc" parameters into the generated URI.
Don't encode a "mv_session_id" argument into the generated URI.
This tag will always add a "mv_session_id" argument to the generated URI, unless the "mv_no_session_id" scratchpad variable is set true and a "MV_SESSION_ID" session cookie was provided with the request for the current page.
Interchange allows you to pass a search in a URI. There are two ways to do this:
The following three links are all identical to one another:
Search variables can be treated just the same as form variables, on the page, except that they can't contain spaces, slashes (/) or quote marks. These characters can be specified using hex-encoded notation, i.e. "%20" is a space and "%2F" is a slash etc.
See the search parameters page for a list of the search variables, along with the two-letter abbreviations that can be used.
See the scan parameter.