Template variables are generally assigned in the Page or Form class that calls the template. In addition, however, many variables are assigned by the TemplateManager
class and are available to all templates:
defaultCharset
: the value of the “client_charset” setting from the [i18n] section of the config.inc.php
configuration filecurrentLocale
: The symbolic name of the current localebaseUr
l: Base URL of the site, e.g. http://www.mylibrary.comrequestedPage
: The symbolic name of the requested pagepageTitle
: Default name of locale key of page title; this should be replaced with a more appropriate setting in the templatesiteTitle
: If the user is currently browsing a page associated with a journal, this is the journal title; otherwise the site title from Site ConfigurationpublicFilesDir
: The URL to the currently applicable Public Files directory (See the section titled File Management)pagePath
: Path of the requested page and operation, if applicable, prepended with a slash; e.g. /user/profilecurrentUrl
: The full URL of the current pagedateFormatTrunc
: The value of the date_format_trunc
parameter in the [general]
section of the config.inc.php
configuration file; used with the date_format Smarty functiondateFormatShort
: The value of the date_format_short parameter in the [general]
section of the config.inc.php
configuration file; used with the date_format Smarty functiondateFormatLong
: The value of the date_format_long parameter in the [general]
section of the config.inc.php
configuration file; used with the date_format Smarty functionatetimeFormatShor
t: The value of the datetime_format_short
parameter in the [general]
section of the config.inc.php
configuration file; used with the date_format Smarty functiondatetimeFormatLong
: The value of the datetime_format_long
parameter in the [general]
section of the config.inc.php
configuration file; used with the date_format Smarty functioncurrentLocale
: The name of the currently applicable locale; e.g. en_US
articleSearchByOptions
: Names of searchable fields used by the search feature in the sidebar and on the Search pageuserSession
: The current Session objectisUserLoggedIn
: Boolean indicating whether or not the user is logged inloggedInUsername
: The current user’s username, if applicablepage_links
: The maximum number of page links to be displayed for a paged list within the current Journal or site context.items_per_page
: The maximum number of items to display per page of a paged list within the current Journal or site context.Additionally, if the user is browsing pages belonging to a particular journal, the following variables are available:
currentJournal
: The currently-applicable journal object (of the Journal
class)alternateLocale1
: First alternate locale (alternateLocale2
) journal settingalternateLocale2
: Second alternate locale (alternateLocale1
) journal settingnavMenuItems
: Navigation items (navItems
) journal settingpageHeaderTitle
: Used by templates/common/header.tpl
to display journal-specific informationpageHeaderLogo
: Used by templates/common/header.tpl
to display journal-specific informationalternatePageHeader
: Used by templates/common/header.tpl
to display journal-specific informationmetaSearchDescription
: Current journal’s description; used in meta tagsmetaSearchKeywords
: Current journal’s keywords; used in meta tagsmetaCustomHeaders
: Current journal’s custom headers, if defined; used in meta tagsstylesheets
: An array of stylesheets to include with the templatepageFooter
: Custom footer content to be displayed at the end of the pageIf multiple languages are enabled, the following variables are set:
enableLanguageToggle
: Set to true when this feature is enabledlanguageToggleLocales
: Array of selectable locales