PUBURLPATH -- generate a relative URL for an attachment

Generate a relative URL for an attachment, or for a web or topic within the attachment database.

Parameters

Parameter Description Default
"attachment" Name of attachment to link  
web Web  
topic Topic, or Web.Topic  
topic_version Select topic version, if supported most recent
attachment_version Select attachment version, if supported most recent

Examples

ALERT! This macro will only generate a relative URL if the store supports them, and the context allows it. Otherwise it will generate the same as PUBURL

HELP The 'old' way of building URLs using PUBURLPATHPATH involved concatenating the web and topic names to the PUBURLPATH e.g. %PUBURLPATH%/%WEB%/%TOPIC%. This practice is strongly discouraged, as it does not correctly handle encoding of the parts of the URL. At the first opportunity you should replace all such URLs with the equivalent %PUBURLPATH%{topic="System.MainFeatures"}%, which will handle URL encoding for you.

IDEA! ATTACHURLPATH provides a shorter way to refer to the attachments on the current topic.

PUBURL, ATTACHURL, ATTACHURLPATH, SCRIPTURL, SCRIPTURLPATH, FileAttachments