Theme templates variable reference

Table of content

This page describes the variables available for each template, along with example values.

You can print all these variables and their actual values in your logs by activating the debug mode in the "Advanced" section of Ubooquity settings.

CSS files

Relevant templates

All CSS files.

Variables

Name Example value Description
rootPath /proxy-prefix The prefix part of Ubooquity URL if a proxy is defined, an empty string otherwise.
coverWidth 160 Width of an item cover.
coverHeight 230 Height of an item cover.

Login page

Relevant templates

Variables

Name Example value Description
rootPath /proxy-prefix The prefix part of Ubooquity URL if a proxy is defined, an empty string otherwise.
loginScripts <script type="text/javascript" ...</script> The JS scripts required by the login page. Always include this.
hiddenInputs <input type="hidden" id="serversalt"... name="hash"/> The input fields required by the login page. Always include this.
formId loginform The id of the HTML login form. Provided by the server so that it stays consistent with the scripts.
loginFieldName login The name of the login field. Provided by the server so that it stays consistent with the scripts.
passwordFieldId passwordfield The id of the password field. Provided by the server so that it stays consistent with the scripts.
onLoginClick submitform(); The JS function to call when the login button is clicked. Provided by the server so that it stays consistent with the scripts.

Home page

Relevant templates

Variables

Name Example value Description
rootPath /proxy-prefix The prefix part of Ubooquity URL if a proxy is defined, an empty string otherwise.
userName Tom The name of the currently logged user. Null if security is disabled.
displayRawFiles
true
Boolean. True if the "raw files" section is activated in the settings.
rawFilesUrl /proxy-prefix/files/ URL of the "raw files" section, if activated.
displayNoFileMessage
false
Boolean. True if no file is accessible to the current user (or if no file is shared at all).
categories
categoryUrl /proxy-prefix/comics URL of the category section.
categoryName Comics Display name of the category (used in URLs).
categoryId comics Id of the category.
categoryItemCount 1234 Item count for this category.
categoryLatestUrl /proxy-prefix/comics?latest=true URL of the page for the most recently added items of the category.
categoryLatestId latest-comics Id of the link element that contains the "categoryLatestUrl" URL.

Library - category root folders page

Relevant templates

Variables

Name Example value Description
rootPath /proxy-prefix The prefix part of Ubooquity URL if a proxy is defined, an empty string otherwise.
parentUrl /proxy-prefix/comics/47 The URL of the parent page.
prev10pageUrl ?index=0 URL of the 10th previous page.
prev10pageClass hidden "hidden" if there are less than 10 pages before this one, an emtpy string otherwise.
prevPageUrl ?index=1 URL of the previous page.
prevPageClass hidden "hidden" if there is a previous page, an emtpy string otherwise.
nextPageUrl ?index=3 URL of the next page.
nextPageClass hidden "hidden" if there is no next page, an emtpy string otherwise.
next10pageUrl ?index=13 URL of the 10th next page.
next10pageClass hidden "hidden" if there are less than 10 pages after this one, an emtpy string otherwise.
pageNumber 2 Number of the current page.
displayPageSelector
false
Boolean, true if the page selection pop-pup link should be displayed.
checkedSortDesc checked="true" The string 'checked="true"' if the sorting order is DESCENDING. An empty string otherwise.
checkedSortByWriters checked="true" The string 'checked="true"' if the sorting criterion is WRITER. An empty string otherwise.
checkedSortByDate checked="true" The string 'checked="true"' if the sorting criterion is DATE. An empty string otherwise.
checkedSortByTitle checked="true" The string 'checked="true"' if the sorting criterion is TITLE. An empty string otherwise.
checkedSortByFileName checked="true" The string 'checked="true"' if the sorting criterion is FILE NAME. An empty string otherwise.
checkedNoGrouping checked="true" The string 'checked="true"' if the grouping criterion is NONE. An empty string otherwise.
checkedGroupByFolder checked="true" The string 'checked="true"' if the grouping criterion is FOLDER. An empty string otherwise.
checkedSortAsc checked="true" The string 'checked="true"' if the sorting order is ASCENDING. An empty string otherwise.
checkedSortByFilePath checked="true" The string 'checked="true"' if the sorting criterion is FILE PATH. An empty string otherwise.
pageSelectorLinks <a href="?index=0" class="pagenumber">1</a><a href=... </a> Links to the different pages of the current folder or category.
isSearchResult
false
Boolean. True if the displayed items are the result of a search.
searchString John Brunner The string entered by the user for a search (empty if no search is undergoing).
totalPages 12 The total number of pages in the current folder or category (depending on the display settings.)
category comics The currently displayed category of items.
pageLabel Search results The label of the page (search results, latests books...), or an empty string if this is a regular page.
rootFolders
folderUrl /proxy-prefix/comics/1 URL of this root folder.
folderName CBR Regular Name of this root folder.

Library - items page

Relevant templates

Variables

Same variables as for the Library - category root folders page above, without the rootFolders variable, and with a list of items (items are books, comics… and the folder containing them).

items
downloadUrl /proxy-prefix/comics/148/Ghost in the shell 01.cbz URL to download this item.
readerUrl /proxy-prefix/pagereader/reader.html#!...dex=0&nbPages=89 URL to open the online reader on this item.
itemId 803 Id of the displayed item.
seriesName The Hitchhiker's Guide to the Galaxy Name of the series the item belongs to, or an empty string.
rating ★★★★☆ The calibre rating found in the item metadata.
language fr-FR Language found in the item matadata.
writers Douglas Adams Writers found in the item matadata.
seriesIndex 2 Index of this item in its series (or an empty string).
tags Novel Science-fiction Humor Tags found in the item matadata.
fileSize 4.8 MB Size of the item file.
fileExtension EPUB Extension of the item file.
publicationDate 2020-07-14 Publication date found in the item matadata.
itemFolderUrl /proxy-prefix/comics/803/ URL of the folder. Useful only if the item is a folder.
isFolder
true
Boolean. True if the item is a folder.
itemCoverUrl /proxy-prefix/cover/803 URL of the cover of this item.
itemTitle Dark Reign - Wolverine Origins Title of this item.
progress 42 Reading progression of this item (integer between 0 and 100).
readingStatusClass status_unread CSS class associated to the reading status. Can be `status_unread`, `status_inprogress` or `status_finished`.
itemChildrenCount 21 Number of elements inside this item (when the item is a folder).

Library - item details

Relevant templates

Variables

Same variables as for the items elements above, with the following additional fields.

Name Example value Description
rootPath /proxy-prefix The prefix part of Ubooquity URL if a proxy is defined, an empty string otherwise.
description In The Restaurant at the End of the Universe (published in 1980), Zaphod is separated from ... Description found in the item matadata.