webCOMAND

#PATHTYPE

Configure how the path returned by #OUTPUT() and #LINK() will be prefixed.

Syntax

#PATHTYPE(string $prefix) ... #ENDPATHTYPE

Parameters

  • prefix - How to start the path returned by #OUTPUT() and #LINK(), specified as one of the following values.
    • Relative (default) - Produce a relative path from the current publish path (or #PATHFROM()).  The path will be prefixed with one or more '../' if needed to traverse up a directories.
    • Root - Produce a rooted path from the Publication's Publish URL (ie. /).
    • Absolute - Produce a full URL starting with the Publication's Publish URL (ie. https://www.example.com/).

Return

This statement does not return a value or produce output.

Path Example

#**
 * Create three URLs that will all correctly link to the same file:
 * css/test.txt
 * /css/test.txt
 * https://www.example.com/css/test.txt
 *#
#PATHTYPE('Relative')
    #OUTPUT('css/test.txt','This is a test.')
#ENDPATHFROM
#PATHTYPE('Root')
    #OUTPUT('css/test.txt','This is a test.')
#ENDPATHFROM
#PATHTYPE('Absolute')
    #OUTPUT('css/test.txt','This is a test.')
#ENDPATHFROM

Related

#PATHTO(), #PATHFROM()