Request variables and edit links - example Last updated: 03. Jan 2023

Examples on how to get current folder, url, site name, edit links, page title and more.

Example

Code Test.hash

<h1>This page</h1>
<div>
    You are on page: #request.filepath#<br>
    The edit URL's opens the folders and documents directly in Docly (login required).<br>
    <br>
    <a href="#request.opendoc#">Edit current document</a><br>
    <a href="#request.openfolder#">Open containing folder</a>
</div>

<h2>Pages:</h2>
<ul>
#for(var page of docly.getFiles(request.folderpath)) {#
    <li>#page.filename# <a href="#page.opendoc#">Edit this subpage</a></li>
#}#
</ul>

<p>
    Updated: #format(LastWriteTime, "dd.MM.yyyy HH:mm")#
</p>
<p>
    For a complete list of request variables, see this page:
    https://developers.docly.net/JavaScript/Output-functions/Request
</p>

Output

<h1>This page</h1>
<div>
    You are on page: /JavaScript examples/Websites/Request variables and edit links - example<br>
    The edit URL's opens the folders and documents directly in Docly (login required).<br>
    <br>
    <a href="https://docly.net/#DFhjT0FIXIkuAo8U9mFCSkA?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit current document</a><br>
    <a href="https://docly.net/#FuHHTZVE-v0in7NYYR_fJPQ">Open containing folder</a>
</div>

<h2>Pages:</h2>
<ul>
    <li>Documentation integration example <a href="https://docly.net/#D0_rWA-nyTUKv_a-1tJ4TEw?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Breadcrumb example <a href="https://docly.net/#Dfhky8SlolkeTynCQLhQhjA?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Sending forms by e-mail <a href="https://docly.net/#DmiwlIZQ8YUCldNhUP_0smQ?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Linking images and files in hash <a href="https://docly.net/#DQv5xycsPNkq_S0UCJLtmeg?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Menu with active class (hash) <a href="https://docly.net/#DRZeVe0Q_K02dgT57W4keQw?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Using published folder search <a href="https://docly.net/#DvnOUD6DGyUiMIaoaMviN0w?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Prevent Docly changing HREF and SRC <a href="https://docly.net/#Ddd4BEMnEtEeyzrrMIA8TXg?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>How to make JS and CSS bundles <a href="https://docly.net/#D5KSYOvSNzEGIT5xEvt83xg?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Redirect to a page or site <a href="https://docly.net/#Dp0nH7PDbu0mErhgloV_dvA?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Example of dynamic sitemap.xml file <a href="https://docly.net/#Dg5DKOe8yOkONnafwL50pyA?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Setting and adding meta tags to head <a href="https://docly.net/#DaYqeyIskRUq9NzGCzFw16Q?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Request variables and edit links - example <a href="https://docly.net/#DFhjT0FIXIkuAo8U9mFCSkA?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
    <li>Implementing caching in an API function <a href="https://docly.net/#DN_-fRnNqyEilCxBlYIwzPA?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript-examples%2fWebsites%2fRequest-variables-and-edit-links---example">Edit this subpage</a></li>
</ul>

<p>
    Updated: 03.01.2023 12:40
</p>
<p>
    For a complete list of request variables, see this page:
    https://developers.docly.net/JavaScript/Output-functions/Request
</p>