I am one of the bureaucrats of https://be.wikimedia.org
We would like to use the UserFunctions extension on all generic namespaces of the site, if possible.
I am one of the bureaucrats of https://be.wikimedia.org
We would like to use the UserFunctions extension on all generic namespaces of the site, if possible.
This is likely not going to get done since the extension is not deployed on Wikimedia so would have to pass the lengthy https://www.mediawiki.org/wiki/Writing_an_extension_for_deployment process.
I doubt that extension is compatible with the parser cache setup on Wikimedia wikis.
May I ask which problem are you trying to solve with this extension?
I would like to have/use a "magic word" (template/function) to get the username of the account that is currently logged in -- to be able to use it as a parameter/suffix in a semi-dynamic URL.
Example:
[[wmfdashboard:users/{{#username:alt}}|My impact]]
That use case got declined in the past in T6196: New user-specific variable (magic word, parser function) giving {{USERNAME}} ({{CURRENTUSER}} {{USER}}).
I understand that MediaWiki core functions in this context have a negative impact on cache performance.
Only using jQuery, I got the following result, using a page, a template, and a Common.js:
[[wmfdashboard:users/{{wgUserName}}|My impact]]
[[wmfdashboard:users/Geertivp|My impact]]
Template:wgUserName:
<span id="wgUserName"></span>
<span>Geertivp</span>
What I would like to get is:
Geertivp
MediaWiki:Common.js:
$( function( $ ) { var TagId = document.getElementById("wgUserName"); var UserName = mw.config.get('wgUserName'); if (TagId !== null && UserName !== null) { TagId.innerText = UserName; } } );
Who could provide me with the missing logic to remove the <span> result, because this is messing up the URL syntax?
How does wp.fr show my username?
https://fr.wikipedia.org/wiki/Wikipédia:Accueil_principal
I believe that’s because the software passes the name of the currently logged-in user as a variable to the mainpage-title-loggedin system message (which is locally defined as Bienvenue $1).