Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Variable in MediaWiki for the current user

In MediaWiki, you can use a variable ("Magic Word") such as

{{PAGENAME}}

or

{{REVISIONDAY}}

to get specific information related to the current page being viewed. Is there a similar variable (or perhaps a different way) to get the current user who is logged in to the wiki, i.e. something like

{{USERNAME}}

context: Trying to use the #ask query in Semantic MediaWiki to narrow the list of resulting pages to show those only the user has created or edited:

{{#ask: [[Case Reflection:+]] [[Contributing User::{{USERNAME}}]]
 | format=template
 | template=Case Reflection Form Summary
 | link=all
 | sort=Last Edited
 | order=DESC
 | default=You have no case reflections related to this Case Study.}}
like image 238
romeboards Avatar asked Oct 17 '12 04:10

romeboards


People also ask

What is extension variables?

The Variables extension allows you to define a variable on a page, use it later in that same page or included templates, change its value, possibly to a value given by an expression in terms of the old value, etc.


1 Answers

There are a bunch of extensions for that such as GetUserName, MyVariables, UserInfo. The whole concept of showing usernames is incompatible with page caching though (you need to parse the page again every time someone looks at it) so generally not a good idea.

like image 55
Tgr Avatar answered Nov 01 '22 04:11

Tgr