I'm working on a (clearly :-) non-WMF project using MediaWiki, and I've tripped over something that I can't figure out how to do using the templating language.
Several things I've seen in various WP templates suggest there are many thing about that part of the parser that I don't understand (and can't locate doco for), but if there's a better list than this on which to ask, please let me know.
And so, to the problem:
I'm trying to use MW as a database.
I just wanted to get out of the way up front that I realize that's the problem here. :-)
I have a template ("A").
This template is instantiated on many pages ("A"->"B", "A"->"C", "A"->"D").
Those pages are in turn transcluded onto other pages:
"A"->"B"->"E" "A"->"B"->"F" "A"->"B"->"G" "A"->"C"->"H" "A"->"C"->"I" "A"->"C"->"J" "A"->"D"->"K" "A"->"D"->"L"
What I'm trying to accomplish is to include a link on "A" that, when the user is looking at "I" will permit them to edit "C".
I had been hoping that I could include the PAGENAMEE magic word in the template ("A") as part of an HTTP edit link, but alas, PAGENAMEE (and presumably all the other magic words that pertain to pages) bind so late in the parse chain that they point to "I" in that situation.
In a situation like this, is there any reasonable way to grab the name of "C" from inside the code of "A"? Something with subst:, maybe?
The actual pages are A: http://tbkinfo.net/wiki/index.php/Template:Infobox_Show C: http://tbkinfo.net/wiki/index.php/O%27Maddy%27s_House I: http://tbkinfo.net/wiki/index.php/O%27Maddy%27s
Cheers, -- jra
Maybe you could instatiate A in B as {{A|B}}, in C as {{A|C}} etc. to get C in A, when A gets into I?
"Jay R. Ashworth" wrote:
I have a template ("A").
This template is instantiated on many pages ("A"->"B", "A"->"C", "A"->"D").
Those pages are in turn transcluded onto other pages:
"A"->"B"->"E" "A"->"B"->"F" "A"->"B"->"G" "A"->"C"->"H" "A"->"C"->"I" "A"->"C"->"J" "A"->"D"->"K" "A"->"D"->"L"
What I'm trying to accomplish is to include a link on "A" that, when the user is looking at "I" will permit them to edit "C".
I had been hoping that I could include the PAGENAMEE magic word in the template ("A") as part of an HTTP edit link, but alas, PAGENAMEE (and presumably all the other magic words that pertain to pages) bind so late in the parse chain that they point to "I" in that situation.
In a situation like this, is there any reasonable way to grab the name of "C" from inside the code of "A"? Something with subst:, maybe?
The actual pages are A: http://tbkinfo.net/wiki/index.php/Template:Infobox_Show C: http://tbkinfo.net/wiki/index.php/O%27Maddy%27s_House I: http://tbkinfo.net/wiki/index.php/O%27Maddy%27s
Cheers, -- jra
On Sat, Feb 18, 2006 at 11:05:14PM +0100, Platonides wrote:
Maybe you could instatiate A in B as {{A|B}}, in C as {{A|C}} etc. to get C in A, when A gets into I?
I could, if that's the only solution. But everything except A will be being created by civilians.
Cheers, -- jra
On Sat, Feb 18, 2006 at 01:03:17PM -0500, Jay R. Ashworth wrote:
I have a template ("A").
This template is instantiated on many pages ("A"->"B", "A"->"C", "A"->"D").
Those pages are in turn transcluded onto other pages:
"A"->"B"->"E" "A"->"B"->"F" "A"->"B"->"G" "A"->"C"->"H" "A"->"C"->"I" "A"->"C"->"J" "A"->"D"->"K" "A"->"D"->"L"
What I'm trying to accomplish is to include a link on "A" that, when the user is looking at "I" will permit them to edit "C".
I had been hoping that I could include the PAGENAMEE magic word in the template ("A") as part of an HTTP edit link, but alas, PAGENAMEE (and presumably all the other magic words that pertain to pages) bind so late in the parse chain that they point to "I" in that situation.
In a situation like this, is there any reasonable way to grab the name of "C" from inside the code of "A"? Something with subst:, maybe?
And it turns out I was damned close. Further spelunking in the help, which I was too sick to do the other day, apparently, suggests that the comments in the subst section at
http://en.wikipedia.org/wiki/Help:Variable#Depending_on_page
to wit:
When a template containing {{<includeonly>subst:</includeonly>PAGENAME}} is subst'ed in a page, the name of the latter page is put in the wikitext, and similarly for other variables.
which is precisely what I need: when someone creates a B which transcludes A, B will contain it's own name as part of the edit link.
But it doesn't appear to be working. The created B instead includes the uninterpreted {{<includeonly>subst:</includeonly>PAGENAME}} .
This is in 1.5.3. That help page doesn't say 1.6-only as some do; is this a 1.6-only behavior anyway? Or am I missing something else?
Cheers, -- jra
On Mon, Feb 20, 2006 at 03:52:58PM -0500, Jay R. Ashworth wrote:
When a template containing {{<includeonly>subst:</includeonly>PAGENAME}} is subst'ed in a page, the name of the latter page is put in the wikitext, and similarly for other variables.
which is precisely what I need: when someone creates a B which transcludes A, B will contain it's own name as part of the edit link.
But it doesn't appear to be working. The created B instead includes the uninterpreted {{<includeonly>subst:</includeonly>PAGENAME}} .
This is in 1.5.3. That help page doesn't say 1.6-only as some do; is this a 1.6-only behavior anyway? Or am I missing something else?
As RedACE pointed out on IRC, it's <includeonly> that's version specific, and while it's supposed to require 1.6, I'm told it will probably work on 1.5.6, which we'll upgrade to tonight.
Cheers, -- jra
On Tue, Feb 21, 2006 at 01:47:38PM -0500, Jay R. Ashworth wrote:
On Mon, Feb 20, 2006 at 03:52:58PM -0500, Jay R. Ashworth wrote:
When a template containing {{<includeonly>subst:</includeonly>PAGENAME}} is subst'ed in a page, the name of the latter page is put in the wikitext, and similarly for other variables.
which is precisely what I need: when someone creates a B which transcludes A, B will contain it's own name as part of the edit link.
But it doesn't appear to be working. The created B instead includes the uninterpreted {{<includeonly>subst:</includeonly>PAGENAME}} .
This is in 1.5.3. That help page doesn't say 1.6-only as some do; is this a 1.6-only behavior anyway? Or am I missing something else?
As RedACE pointed out on IRC, it's <includeonly> that's version specific, and while it's supposed to require 1.6, I'm told it will probably work on 1.5.6, which we'll upgrade to tonight.
Spake I too soon.
The link, in my 'A' template, looks like this:
[http://tbkinfo.net/wiki/index.php?title=%7B%7B<includeonly>subst:</includeonly>NAMESPACE}}:{{<includeonly>subst:</includeonly>PAGENAMEE}}&action=edit (edit this show)]
When I'm looking at the rendered version *of A*, I get a link with A's edit URL:
http://tbkinfo.net/wiki/index.php?title=Template:Infobox_Show&action=edi...
If I include A in C, I get the raw text of the includeonly tags:
http://tbkinfo.net/wiki/index.php?title=%7B%7Bsubst:NAMESPACE%7D%7D:%7B%7Bsu...
while I'm looking at the link on C.
TimStarling: is that the bug you thought you backported a fix for? Or am I just screwed until 1.6?
Cheers, -- jra
wikitech-l@lists.wikimedia.org