Variable Plugin

Compatible with DokuWiki

> 2008-05-05 > 2007-06-26 > 2006-11-06

plugin Displays some dynamic info about the current page, user or date. It uses exactly the same syntax and variables as namespace templates. (previous authors: Esther Brunner)

Last updated on
2009-03-25
Provides
Syntax
Repository
Source

Tagged with date, email, include, template, users

Installation

Use this address plugin-var for installing it through the plugin-manager.

Syntax

@ID@ full ID of the page
@NS@ namespace of the page
@PAGE@ page name (ID without namespace and underscores replaced by spaces)
@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
@DAY@ current day in DD format
@TITLE@ first heading of the current page
@WIKI@ tiltle of the wikis as configured in title
@SERVER@ the content of $_SERVER['SERVER_NAME']

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.

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. More Info [dokuwiki] – — ryan.chappelleLuis Machuca Bezzaza
ryan.chappelle

Temuco, Chile
2010/12/18 19:34

Changelog

FAQ

Is there any way of using these variables within a <code> 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 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

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 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 B. 2009/01/30 20:05

Done! — Michael Klier 2009/03/25 11:40
plugin/var.txt · Last modified: 2011/06/18 18:00 by ach
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate