Load data from other documents Last updated: 21. Jul 2026

Use this example to load data from other Docly files and bind / insert values into another document.

Loading data from files / documents

<div>
    <!-- Get data from other page (file or document type) -->
    #let p = docly.getFile("filepath/filename")#
    
    <!-- Bind data to page, read from variable "p": -->
    #p.Fieldname1#
    #p.Fieldname2#
</div>

Inserting an image

<div>
    <!-- Get data from other page (file or document type) -->
    #let p = docly.getFile("filepath/filename")#
    
    <!-- Pass the file object first: linkImage prepends p.Url for you -->
    <img src="#docly.linkImage(p, p.FileField1, 1024, 768, 1, 'virtual-name.jpg')#" alt="An image" />
</div>

Inserting a download link to a file

<div>
    <!-- Get data from other page (file or document type) -->
    #let p = docly.getFile("filepath/filename")#
    
    <!-- Same for a non-image file: linkFile takes the file object first too -->
    <a href="#docly.linkFile(p, p.FileField1, 'Virtual-name.txt')#" download>Download file</a>
</div>