====== Variable Plugin ====== ---- plugin ---- description: Displays some dynamic info about the current page, user or date. It uses exactly the same syntax and variables as namespace templates. author : Dokufreaks (previous authors: Gina Häußge, Michael Klier, Luis Machuca Bezzaza, Esther Brunner) email : freaks@dokuwiki.org type : syntax lastupdate : 2020-09-27 compatible : 2012-01-25 "Angua", 2011-05-25, 2011-05-25 "Rincewind", 2010-11-07 "Anteater", adora belle, Binky, Weatherwax, 2014-09-29 "Hrun", 2015-08-10, "Elenor of Tsort", "Frusterick Manners", "Greebo", "Hogfather", "Igor" depends : conflicts : similar : tags : include, template, date, email, users downloadurl: https://github.com/dokufreaks/plugin-var/tarball/master sourcerepo : https://github.com/dokufreaks/plugin-var bugtracker : https://github.com/dokufreaks/plugin-var/issues demourl : http://ryan.gulix.cl/tests.doku/current_/ ---- ===== Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. ===== Syntax ===== ^ @ID@ | full ID of the page | ^ @NS@ | namespace of the page | ^ @NSL@ | full external link to current namespace | ^ @PAGE@ | page name (ID without namespace and underscores replaced by spaces) | ^ @PAGEL@ | full external link to current page | ^ @USER@ | ID of current user | ^ @NAME@ | full name of current user | ^ @MAIL@ | mail address of current user | ^ @DATE@ | current date | ^ @YEAR@ | current year in YYYY format | ^ @MONTH@ | current month in MM format | ^ @SMONTH@ | current month in M format (without leading zero) | ^ @DAY@ | current day in DD format | ^ @SDAY@ | current day in D format (without leading zero) | ^ @TITLE@ | first heading of the current page | ^ @WIKI@ | title of the wikis as configured in [[config:title]] | ^ @SERVER@ | the content of ''$_SERVER['SERVER_NAME']'' | ^ @VER@ | the contents returned by ''getVersion()'', such as “//Release 2013-12-08 "Binky"//” | ^ @VERR@ | the release date as extracted from ''getVersion()'' | ^ @VERN@ | the release name as extracted from ''getVersion()'' | ^ @ALIAS@ | the e-mail alias of the current user e.g. ''john.doe''. If a different separator than the dot is required you can also use **@ALIAS_@** or **@ALIAS-@** | :!: **This plugin doesn't work within titles, links and other substitution patterns, for technical reasons.** Use this plugin only when necessary. It turns caching for the current page off, which may have a negative effect on performance. Live tests available for various Wiki versions: http://ryan.gulix.cl/tests.doku/current_/ (the start page of each wiki demonstrates the plugin). ===== Development ===== ==== New Management ==== I'd like to announce my intentions of maintaining this plugin starting Jan 2011, after Chi's (let's hops temporary) exit of the DokuWiki development world. As a starting point a new demo page as well as screenshots and localization strings will be developed in for the next release, which will bring few if any behavioural modifications. //[[http://www.freelists.org/post/dokuwiki/Chis-Legacy,4|More Info [dokuwiki]]]// --- [[user>ryan.chappelle]] //2010/12/18 19:34// >After... a //lot// of time, I pushed an update which incorporates variables for Dokuwiki version information. --- [[user>ryan.chappelle|Luis Machuca Bezzaza]] //2015-06-28 19:49// ==== Changelog ==== {{rss>https://github.com/dokufreaks/plugin-var/commits/master.atom date}} ===== FAQ ===== === Is there any way of using these variables within a block? === Not in any practical way. The unformatted modes (code, file, nowiki) prevent the plugins from replacing content -- and that's expected, since unformatted is for for pasting content //verbatim//. --- //[[luis.machuca@gulix.cl|Luis]] 2010/02/23 18:22// === Will this work with the templater-plugin? === You can use the @-Placeholders on the page where you use the {{template>pagename}} syntax. It's not working inside the sections which have been included by the templater-plugin. ===== Discussion ===== Hello Is there a chance of using a variable like @ID@ in the pagequery plugin? I tried it but it didn't work. Thanks, Daniel After studying the features of this plugin, I have to say this is great. The fact that it can not parse inside links or other constructs (for example, I tried using this alongside the [[plugin:data|Data Plugin]]) is somewhat of an hindrance, but it can be overcome with careful design. However, I would like to propose new variables to be integrated in this plugin, if possible. Among the ones I've planned, I think the following may be useful: * ''@TITLE@'', to expand into the **Page Title** available via the first header, if the ''$conf['useheading']'' option is enabled. That would be essentially a user-friendly alternative to %%@PAGE@%% where needed. * ''@WIKI@'', to expand to the Wiki Name as defined via ''$conf['title']'', and ''@SERVER@'', to expand to the server name as provided by Apache. Mostly to provide uniformity on document-oriented wikis and make them domain-independant if migrations or company changes occur. I want to leave these two for a proposal. --- --- //[[luis.machuca@gulix.cl|Luis Machuca B.]] 2009/01/30 20:05// > Done! --- //[[chi@chimeric.de|Michael Klier]] 2009/03/25 11:40// Would it be possible to display the **groups** the current user belongs to with an @GROUPS@ tag? That would be really helpful as would an entry in the sidebar showing the current ACL conclusion of the permission level for the current user on the current (non-sidebar) page. E,g. None, read, edit, etc. ==== Use var in heading ==== Hi, i want to show the Pagename in a Heading Like this ''====== @PAGE@ ======'' Sadly in the header it do not work. As normal Text it's working. Any ideas where i can do this? --- [[user>cowa|cowa]] //2020-12-09 16:06// ==== Editor details ==== Is there a way to include the last edit user and date and other page meta data so that I can include information such as This page created by @pageCreator@ was last reviewed by @LastEditor@ who made an edit on @LastEditDate@ in the page when it exported/printed??