[Mediawiki-l] different texts for different users

Scheid, Bernhard Bernhard.Scheid at oeaw.ac.at
Wed Apr 6 15:40:47 UTC 2011


Thx! This is exactly what I need. Is it possible/feasible to update to 1.18?

B.

-----Ursprüngliche Nachricht-----
Von: mediawiki-l-bounces at lists.wikimedia.org [mailto:mediawiki-l-bounces at lists.wikimedia.org] Im Auftrag von Krinkle
Gesendet: Mittwoch, 6. April 2011 16:41
An: MediaWiki announcements and site admin list
Betreff: Re: [Mediawiki-l] different texts for different users

Platonides wrote:
> Scheid, Bernhard wrote:
>> Is there any method (Magic Word, etc.) to determine the status/ 
>> usergroup of the user viewing the page?
>> Something like "{{#if: sysop |... }}" ?
>>
>> I would need this in a template that produces different texts for  
>> different users.
>>
>> I tried Extension:ConditionalShow but it did not work (probably not  
>> compatible with MW 1.16?)
>>
>> Thx
>>
>> Bernhard
>
> Not out of the box. You would need an extension or javascript to do  
> such
> switch.

As of 1.18 usergroup-specific site wide resources are / can be loaded.

eg. MediaWiki:Sysop.css / MediaWiki:Sysop.js

What you could have:

== Template:MsgForUser ==
<div class="msgforuser msgforuser-{{lc:{{{group|user}}}}}">
{{{msg|Hello this message is for a specific user-group only}}}
</div>

== MediaWiki:Common.css ==
.msgforuser { display: none; }

== MediaWiki:User.css ==
.msgforuser.msgforuser-user { display: block; }

== MediaWiki:Sysop.css ==
.msgforuser.msgforuser-sysop { display: block; }

== My awesome page ==
Welcome {{MsgForUser | group=sysop | msg=master }}, how are you today ?

Which will display "Welcome, how are you today?" or "Welcome master,
how are you today?" depending on the membership of the user.


Right out of the box support for content for registered-users only,
or sysop, or any other usergroup you may have.

Only takes a few css settings, no JS dependency either.

The only catch is that it's not in 1.16 or 1.17

--
Krinkle

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



More information about the MediaWiki-l mailing list