Url GetPath, GetPathSegments, GetQuery and GetParameters Example

This example shows how retrieve parts of a url.

Smartsite SXML CopyCode image Copy Code
Get the path:
{url.getpath('http://www.smartsite.nl?id=12345&q=cauliflower')}

Get the path segments:
{debug.write(url.getpathsegments('http://ixperion.smartsite.nl/Community/News/Smartsite_iXperion_11.html?foo=bar'))}

Get the querystring:
{url.getquery('http://www.smartsite.nl?id=12345&q=cauliflower')}

Get the querystring parameters:
{debug.write(url.getparameters('http://www.smartsite.nl?id=12345&q=cauliflower'))}
Example Result CopyCode image Copy Code
Get the path:
/

Get the path segments:
Segment=/
Segment=Community/
Segment=News/
Segment=Smartsite_iXperion_11.html

Get the querystring:
?id=12345&q=cauliflower

Get the querystring parameters:
Name=id; Value=12345
Name=q; Value=cauliflower