Free-Conversant Support / Conditional Macro: requestPath
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Conditionals >> Web Server >> requestPath

Conditional Macro: requestPath

Operators:

  • == (equal to)
  • != (not equal to)
  • beginsWith
  • endsWith
  • contains

Usage Notes

  • Tests the path of the page that was requested from the web server, and compares it with the |conditional value| on the right of the |conditional operator|.

  • The requested path always begins with the first forward slash after the domain name. In this example, the request's path is in red:
    http://www.free-conversant.com/docs/conditionals/web_request/userAgent
  • In email and all other IO methods except the web server, the "request path" will be "" (an empty string).

  • The request path never includes any search args (specified with the ?) or path args (specified with the $)

Examples

This example will show line 1 if the page being viewed is in the /docs/ directory (or a sub-directory of that directory), and line 2 for all other cases.

<!--#if condition="requestPath contains '/docs/'"-->

1. This page is part of the published documentation.

<!--#else-->

2. This page is not in the published documenation folder.

<!--#endIf-->

See the above code in action, here:

1. This page is part of the published documentation.

Switching back and forth between this page in the docs and the discussion group message that it was created from will let you see it in action.

View in DG