User Variable for Use in Templates

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

User Variable for Use in Templates

Stéphane Thibault
Hey guys, here's what I'm trying to do.

I'm setting up a MediaWiki website for a scientific association and  
instead of relying only on collaborative writing, it's also important  
that members be allowed to write "signed" articles on a subject that  
may already exist.

What I'd like to do is include a string in the  
[[MediaWiki:Nogomatch]] that would allow the user to create the  
desired article after a failed search, redirecting him to this page:

User:Username/Article

The original article page would then act as a disambiguation page  
listing all articles written on a particular topic.

It should be simple enough but I just can't find the proper variable  
to use for the username in my template. I looked at theses pages:

http://meta.wikimedia.org/wiki/Help:Variable
http://meta.wikimedia.org/wiki/Help:Magic_words

but couldn't find what I'm looking for. Any hints? Is there a built  
in template maybe for "wgUser"? Or maybe even a simpler way to  
achieve this goal?

I originally posted my question over here if anyone's interested on  
this topic:
http://www.mwusers.com/forums/showthread.php?t=999

Thanks,
Stéphane

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: User Variable for Use in Templates

Rob Church
We don't have a {{USERNAME}} variable. It's been requested about 3
times, and each request has been rejected for a good reason; it would
defeat page caching completely. This would not be helpful.

If you want one, you'll need to hack the parser to add it.


Rob Church

On 04/02/06, Stéphane Thibault <[hidden email]> wrote:

> Hey guys, here's what I'm trying to do.
>
> I'm setting up a MediaWiki website for a scientific association and
> instead of relying only on collaborative writing, it's also important
> that members be allowed to write "signed" articles on a subject that
> may already exist.
>
> What I'd like to do is include a string in the
> [[MediaWiki:Nogomatch]] that would allow the user to create the
> desired article after a failed search, redirecting him to this page:
>
> User:Username/Article
>
> The original article page would then act as a disambiguation page
> listing all articles written on a particular topic.
>
> It should be simple enough but I just can't find the proper variable
> to use for the username in my template. I looked at theses pages:
>
> http://meta.wikimedia.org/wiki/Help:Variable
> http://meta.wikimedia.org/wiki/Help:Magic_words
>
> but couldn't find what I'm looking for. Any hints? Is there a built
> in template maybe for "wgUser"? Or maybe even a simpler way to
> achieve this goal?
>
> I originally posted my question over here if anyone's interested on
> this topic:
> http://www.mwusers.com/forums/showthread.php?t=999
>
> Thanks,
> Stéphane
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: User Variable for Use in Templates

Stéphane Thibault
In reply to this post by Stéphane Thibault
Hey everyone,

> We don't have a {{USERNAME}} variable. It's been requested about 3
> times, and each request has been rejected for a good reason; it would
> defeat page caching completely. This would not be helpful.
> Rob Church

With my level of technical knowledge, I'm not exactly sure why this  
would defeat page caching. Do you have a link or two to suggest so I  
would understand better what's at stake here.

I was really planning on relying heavily on this template for the  
design of the wiki I manage and I wouldn't want to hack something in  
that might cause more problems than it solves...

Thanks,
Stéphane


> On 04/02/06, Stéphane Thibault wrote:
>
>> Hey guys, here's what I'm trying to do.
>>
>> I'm setting up a MediaWiki website for a scientific association and
>> instead of relying only on collaborative writing, it's also important
>> that members be allowed to write "signed" articles on a subject that
>> may already exist.
>>
>> What I'd like to do is include a string in the
>> [[MediaWiki:Nogomatch]] that would allow the user to create the
>> desired article after a failed search, redirecting him to this page:
>>
>> User:Username/Article
>>
>> The original article page would then act as a disambiguation page
>> listing all articles written on a particular topic.
>>
>> It should be simple enough but I just can't find the proper variable
>> to use for the username in my template. I looked at theses pages:
>>
>> http://meta.wikimedia.org/wiki/Help:Variable
>> http://meta.wikimedia.org/wiki/Help:Magic_words
>>
>> but couldn't find what I'm looking for. Any hints? Is there a built
>> in template maybe for "wgUser"? Or maybe even a simpler way to
>> achieve this goal?
>>
>> I originally posted my question over here if anyone's interested on
>> this topic:
>> http://www.mwusers.com/forums/showthread.php?t=999
>>
>> Thanks,
>> Stéphane
>>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: User Variable for Use in Templates

Rob Church
MediaWiki can co-operate with external server-side caching mechanisms
such as squid, etc. or maintain an internal parser cache of pages,
which reduces the load on the server somewhat, given that the markup
for a page no longer needs to be parsed upon each hit.

Introducing a variable like {{USERNAME}} would interfere with this
mechanism to some extent. Having said that, I doubt even the senior
developers can keep full track of what's cached when and where, so
it's possible that I'm not quite correct in thinking this. However,
evaluating the feature requests, and considering the caching to date,
it makes sense to me that this would interfere with server-side
caching.

All the above considered, if your wiki is a smaller one, it may be
possible to hack in some workarounds and/or hack in this variable and
disable the parser cache.

It's not *all* cut and dried. ;-)


Rob Church

On 06/02/06, Stéphane Thibault <[hidden email]> wrote:

> Hey everyone,
>
> > We don't have a {{USERNAME}} variable. It's been requested about 3
> > times, and each request has been rejected for a good reason; it would
> > defeat page caching completely. This would not be helpful.
> > Rob Church
>
> With my level of technical knowledge, I'm not exactly sure why this
> would defeat page caching. Do you have a link or two to suggest so I
> would understand better what's at stake here.
>
> I was really planning on relying heavily on this template for the
> design of the wiki I manage and I wouldn't want to hack something in
> that might cause more problems than it solves...
>
> Thanks,
> Stéphane
>
>
> > On 04/02/06, Stéphane Thibault wrote:
> >
> >> Hey guys, here's what I'm trying to do.
> >>
> >> I'm setting up a MediaWiki website for a scientific association and
> >> instead of relying only on collaborative writing, it's also important
> >> that members be allowed to write "signed" articles on a subject that
> >> may already exist.
> >>
> >> What I'd like to do is include a string in the
> >> [[MediaWiki:Nogomatch]] that would allow the user to create the
> >> desired article after a failed search, redirecting him to this page:
> >>
> >> User:Username/Article
> >>
> >> The original article page would then act as a disambiguation page
> >> listing all articles written on a particular topic.
> >>
> >> It should be simple enough but I just can't find the proper variable
> >> to use for the username in my template. I looked at theses pages:
> >>
> >> http://meta.wikimedia.org/wiki/Help:Variable
> >> http://meta.wikimedia.org/wiki/Help:Magic_words
> >>
> >> but couldn't find what I'm looking for. Any hints? Is there a built
> >> in template maybe for "wgUser"? Or maybe even a simpler way to
> >> achieve this goal?
> >>
> >> I originally posted my question over here if anyone's interested on
> >> this topic:
> >> http://www.mwusers.com/forums/showthread.php?t=999
> >>
> >> Thanks,
> >> Stéphane
> >>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: User Variable for Use in Templates

Bugzilla from rowan.collins@gmail.com
In reply to this post by Stéphane Thibault
On 06/02/06, Stéphane Thibault <[hidden email]> wrote:
> With my level of technical knowledge, I'm not exactly sure why this
> would defeat page caching. Do you have a link or two to suggest so I
> would understand better what's at stake here.

Basically, page caching means storing processed pages so that they can
be served to multiple users without the extra processing required to
recreate them from wikitext. If you get as many visitors as, say,
Wikipedia, this amounts to a *huge* saving in the amount of servers
you need to keep the site responsive.

If you had a {{USERNAME}} variable, no two users would ever see the
same version of a page, so they couldn't be cached. (Obviously, the
link to "User:..." at the top of the screen is generated each time
anyway, but the *content* of the page can still be cached locally, and
stuck inside the extra bits of skin)

As Rob says, though, if you're only running a small site, it may not
be too much of a problem to disable the relevant levels of cache,
letting each page be rendered fresh.

--
Rowan Collins BSc
[IMSoP]
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l