![]() |
| > Home > Documentation > Latest documentation > Interchange tags > area |
|
areaReturns a URI for an Interchange page or form action, including the Interchange session ID and supplied arguments, as appropriate. Summary
ExamplesTag expansion example
Perl example
or similarly with positional parameters:
DescriptionThe 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:
ParametershrefThe Interchange page name you would like to create a URI for, relative to the "pages" directory. See the PageDir local (catalog.cfg) configuration directive. If the form parameter is used then the href will default to "process" (see ProcessPage), if not specified otherwise. Special href values
argProviding 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:
add_dot_htmlIf 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. add_sourceIf 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. aliasformThis 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. Once on the target page, this tag's "arg" parameter value can be retrieved using either [data session arg] or [cgi mv_arg]. 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 path will be extracted and a new URI will be built using the website's VendUrl (or SecureUrl) instead. The URI, in this case, will include mv_session_id and mv_pc parameters, as appropriate, along with any values supplied with the "form" or "arg" parameters. For example:
If you want to encode URI arguments into an external URI then you will have to do it yourself using something like the following:
Don't forget to urlencode your URI arguments appropriately if you use something like the above. link_relativeIf 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: Without link_relative
With link_relative
match_securitySet secure true if the current page is secure. no_countDon'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. no_sessionNever encode "mv_session_id" nor "mv_pc" parameters into the generated URI.
no_session_idDon'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.
oncescanInterchange 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 one-click searches section of the page Interchange search engine for more information. See the search parameters page for a list of the search variables, along with the two-letter abbreviations that can be used. searchSee the scan parameter. secureMakes use of the website's SecureURL, instead of the VendURL, to create a "secure" internal URI. If the href is in the AlwaysSecure list then this parameter will be always be true.
|
| Home | Legal nonsense | Privacy policy | Contact us |