View Download Link
view_download_link is a legacy helper that builds an encrypted download URL path using a base template path plus encrypted segments.
This is an immediate-execution single tag.
For most modern implementations, prefer get_download_link or download_file_form.
See also:
Parameters
template
Base template path used as URL prefix.
The encrypted file/member parts are appended to this path.
template="{path=cart_software/download_file}"
file
Required file path to encrypt into the generated URL.
If missing, the tag returns download_url_not_specified error.
file="/var/www/html/themes/user/cartthrob/images/cartthrob_logo_bg.jpg"
member_id
Optional member restriction segment.
Supports dynamic values:
CURRENT_USER{logged_in_member_id}{member_id}member_id=”CURRENT_USER”
Behavior and Constraints
- Starts output with
templatevalue. - Encrypts and appends
fileas URL segment. - If
member_idis provided, resolves dynamic placeholders and appends encrypted member segment. - Returns the final URL string.
Notes:
- This helper only supports
fileand optionalmember_idin this implementation. - It does not generate ACT query strings like
get_download_linkdoes. - Legacy helper retained for older templates/tutorials.
Examples
Legacy software-download tutorial style:
<a href="{exp:cartthrob:view_download_link
template='{path=cart_software/download_file}'
file='{path=themes/cp_themes/default/cartthrob/../images/cartthrob_logo_bg.jpg}'
member_id='{logged_in_member_id}'}">Download</a>
Without member restriction:
<a href="{exp:cartthrob:view_download_link template='{path=downloads/file}' file='/var/www/files/product.zip'}">Download</a>