Load data from other documents Last updated: 30. Mar 2023

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")#
    
    <!-- Link image from other page and scale -->
    <img src="#p.Url#/#p.FileField1#/1024x768x1/virtual-name.jpg" alt="An image" />
</div>

See also following guide:
https://developers.docly.net/JavaScript-examples/Websites/Linking-images-and-files-in-hash

Inserting a download link to a file

<div>
    <!-- Get data from other page (file or document type) -->
    #let p = docly.getFile("filepath/filename")#
    
    <!-- Link image from other page and scale -->
    <a href="#p.Url#/#p.FileField1#/Virtual-name.txt" alt="An image">Download file</a>
</div>