b:env.request

<b:env.request />

The current URL request

Unlike <b:page.metadata.url />, <b:env.request /> is the full URL request that the user made. The information includes protocol, domain and the full path to the page.

Attributes

clear

(optional)

takes of information from the request.

Values can be:

  • protocol - Clears of the protocol from the request.
  • domain - Clears protocol and the domain.
  • root - Clears protocol, domain and the path to the site root.

depth

(optional)

Returns the URL from a certain depth. When the number is positive, the levels are counted from the left. When it's negative, the number of levels are taken of from the request.

If clear attribute is given, the request will be cleared first and levels will be calculated then.

Examples

Reading and handling the request information

In this example the template is accessed via this URL:
http://www.mydomain.com/finland/products/cheese/

And the Bildy site root is:
/finland

Vanilla: <b:env.request />

Clear protocol: <b:env.request clear="protocol" />

Clear domain: <b:env.request clear="domain" />

Clear root: <b:env.request clear="root" />

Depth 2: <b:env.request depth="2" />

Depth -2: <b:env.request depth="-2" />

Clear root and depth -1: <b:env.request clear="root" depth="-1" />
HTML source output
Vanilla: http://www.mydomain.com/finland/products/cheese

Clear protocol: www.mydomain.com/finland/products/cheese

Clear domain: /finland/products/cheese

Clear root: /products/cheese

Depth 2: http://www.mydomain.com/finland/products

Depth -2: http://www.mydomain.com/finland

Clear root and depth -1: /finland/products