Template magick?

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

Template magick?

The Cunctator
Is there some way to write a working template that does what I'd like
it to do with this (nonworking) code?

As of [{{<includeonly>subst:</includeonly>FULLPAGENAME|oldid={{REVISIONID}}}}
this edit], this article uses content from {{{source}}}.

This is from [[Template:GFDLSource]]

As you can see, I'm trying to automatically stamp the article with a
link to the current revision.
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Template magick?

Minh Nguyen-2
The Cunctator wrote:

> Is there some way to write a working template that does what I'd like
> it to do with this (nonworking) code?
>
> As of [{{<includeonly>subst:</includeonly>FULLPAGENAME|oldid={{REVISIONID}}}}
> this edit], this article uses content from {{{source}}}.
>
> This is from [[Template:GFDLSource]]
>
> As you can see, I'm trying to automatically stamp the article with a
> link to the current revision.

<http://en.wikipedia.org/wiki/Template:Archivebox> uses similar code,
but it only works if you subst: the template into a page. Getting
something like this to work without subst:'ing would be great for the
Vietnamese Wikipedia, though. We have a lot of places where we'd like to
have timestamps, but users don't ever remember to use the five squigglies.

--
Minh Nguyen <[hidden email]>
AIM: trycom2000; Jabber: [hidden email]; Blog: http://mxn.f2o.org/

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

Re: Template magick?

Phil Boswell
In reply to this post by The Cunctator
"The Cunctator" <[hidden email]> wrote in
message news:[hidden email]...

> Is there some way to write a working template that does what I'd like
> it to do with this (nonworking) code?
>
> As of
> [{{<includeonly>subst:</includeonly>FULLPAGENAME|oldid={{REVISIONID}}}}
> this edit], this article uses content from {{{source}}}.
>
> This is from [[Template:GFDLSource]]
>
> As you can see, I'm trying to automatically stamp the article with a
> link to the current revision.

I would have suggested
{{fullurl:{{subst:FULLPAGENAME}}|oldid={{subst:REVISIONID}}}} but as you can
see from the talk page, {{REVISIONID}} doesn't seem to be defined until
after the save, which means that it would not be avilable for SUBSTitution:
http://en.wikipedia.org/wiki/Template_talk:GFDLSource

HTH HAND
--
Phil
[[en:User:Phil Boswell]]



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

Re: Template magick?

The Cunctator
On 2/20/06, Phil Boswell <[hidden email]> wrote:

> "The Cunctator" <[hidden email]> wrote in
> message news:[hidden email]...
> > Is there some way to write a working template that does what I'd like
> > it to do with this (nonworking) code?
> >
> > As of
> > [{{<includeonly>subst:</includeonly>FULLPAGENAME|oldid={{REVISIONID}}}}
> > this edit], this article uses content from {{{source}}}.
> >
> > This is from [[Template:GFDLSource]]
> >
> > As you can see, I'm trying to automatically stamp the article with a
> > link to the current revision.
>
> I would have suggested
> {{fullurl:{{subst:FULLPAGENAME}}|oldid={{subst:REVISIONID}}}} but as you can
> see from the talk page, {{REVISIONID}} doesn't seem to be defined until
> after the save, which means that it would not be avilable for SUBSTitution:
> http://en.wikipedia.org/wiki/Template_talk:GFDLSource
>
I think I've figured it out:

Template:

As of [{{fullurl:<includeonly>{{FULLPAGENAME}}</includeonly><noinclude><nowiki>{{FULLPAGENAME}}</nowiki></noinclude>|oldid={{{revision}}}}}
this edit], this article uses content from '''{{{source}}}'''. The
original article was at '''[{{{sourcepath}}}
"{{{sourcearticle}}}"]'''. As with [[Wikipedia]], the text of
{{{source}}} is available under the [[Wikipedia:Text of the GNU Free
Documentation License]], and all relevant terms must be followed.

<includeonly>[[Category:GFDL|{{PAGENAME}}]]</includeonly><noinclude><nowiki>[[Category:GFDL|{{PAGENAME}}]]</nowiki></noinclude>

Usage:

{{Template:GFDLSource|source=source
name|sourcepath=url|sourcearticle=article title|revision=Wikipedia
revision id}}

Still trying to figure out if there's any way to usefully use {{REVISIONID}}.
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l