webCOMAND

#PATHTO

Set the destination path that #OUTPUT() will use to write target files when a relative file path is provided.

When an absolute (aka rooted) path is passed to #OUTPUT(), it will not be affected by #PATHTO() because absolute paths are always appended to the Publication's Publish Path.

Syntax

#PATHTO(string $path) ... #ENDPATHTO

Parameters

  • path - The desintation path in one of the following forms.  If a filename is provided at the end of the path, it will be ignored.
    • Relative Path - A relative path will be evaluated relative to the current path.
    • Rooted Path - A rooted path will be evaluated from the Publication's Publish Path.

Return

This statement does not return a value or produce output.

Relative Path Example

#**
 * Create and output an external custom CSS file just for this web page.
 * The custom CSS file will be OUTPUT to a css/ subdirectory, even if
 * we are publishing a file to some other subdirectory.
 *#
#NEW($CSS)
header { height: 80px; background: url(#LINK(Image,HeaderBg)); }
#ENDNEW
#PATHTO('/')
    #NEW($CSSFile)#OUTPUT('css/custom.css',$CSS)#ENDNEW
#ENDPATHTO
<html>
  <head>
    <title>Example Web Page</title>
    <link type="text/css" rel="stylesheet" href="$CSSFile" />
  </head>
  <body>
     <header>Example</header>
     <h1>Example Web Page</h1>
     <p>The cScript template creates and references
     an external custom CSS file.</p>
  </body>
</html>

Related

#PATHFROM(), #PATHTYPE()