Documentation

Integration / TinyMCE option: moxiemanager_file_template

This TinyMCE specific option enables you to insert the selected files as custom HTML. The option expects an HTML string with variables that gets replaced with file data.  This template is used by the insertfile toolbar button and gets used when you insert non image files such as pdf files this would normally be a link to that document.

Variables
VariableDescription
url Url to the selected file.
name Name of the selected file.
path Absolute path to the selected file.
size Size of the selected file in bytes.
parentPath Absolute path to the parent directory of the selected file.
Encoders

Variable values can also be encoded to various formats. These are the built in encoders:

NameDescription
urlencode Encodes the variable in url encoding format.
xmlEncode Encodes the variable in XML encoding. For example these: < > & " '.
sizeSuffix Adds a suffix to sizes for kb/mb etc.
Examples

Insert file with name and size suffix:

moxiemanager_file_template: '<a href="{$url}">{$name} {$size|sizeSuffix}</a>'