Last modified: 2010-04-09 00:43:50 UTC
When using the markup {{<includeonly>subst:</includeonly>PAGENAME}} (or any other magic word. I've tested several and had the same results with all of 'em) on a page, PAGENAME displays the pagename properly when viewing that page. When that page is substed into another page, it displays properly as well. However, when that page is displayed using a template tag (i.e. {{Template:Welcome}}), what is shown on that page is "{{subst:PAGENAME}}" (for example, here's a template with said <includeonly> tags: [[en:User:Blackcap/Welcome]], and here's a page with template tags linking to that page: [[en:User:Kusma/Sandbox#Welcome.2C_.7B.7Bsubst:PAGENAME.7D.7D.21]]). I reckon that what should be shown is simply what {{PAGENAME}} would normally show; thus, the pagename.
Clarification on why I used [[en:Template:Welcome]] as the URL: the bug was found there while trying to find a way to either subst or not subst PAGENAME on that template. Discussion: [[en:Template talk:Welcome#PAGENAME issue]].
You're breaking up the markup with other markup; that tends not to work.
Yet, the additional markup doesn't break when the template is substed. Is that to be expected? If it's the addition markup causing the problem, another editor ([[en:User:Kusma]]) suggested that there be an addition of <substonly> and <nosubst> tags, with the effect that things inside them would only be shown when the page is substed or displayed, respectively. Thus, one could deal with the problem by using the markup "<nosubst>{{PAGENAME}}</nosubst> <substonly>{{subst:PAGENAME}}</substonly>."
If it won't work with <includeonly>, will it work like it was requested in bug 4484? If yes, this bug is a duplicate of bug 4484.
It might be. If what I'm referring to is a bug with <includeonly>, then no. If <includeonly> is intended to operate in the way it does, than yes, it would be a duplicate, and should be marked as such.
The bug (if it can be called a bug, strictly speaking) is that transcluding a substitution is impossible and results in the substitution being treated as a literal. If you transclude "{{subst:foo}}", it can't be substituted into the transclusion, obviously, which is why I'm not sure this is really a bug. Desired behavior is that it be transcluded, with the "subst:" ignored. On the other hand, until bug 4484 and/or bug 2003 are fixed, this behavior is important to force people to subst; a number of templates on enwiki are using this to avoid people accidentally editing a transcluded talk-page template like [[Template:Image source]] by clicking the section edit link, and IMO it would be unwise to take that ability away without replacing it.
*** Bug 8675 has been marked as a duplicate of this bug. ***
Created attachment 7023 [details] A proposed patch The patch attached adds new syntax {{<includeonly>subst:subst:</includeonly>Template}} now acts exactly like {{<includeonly>subst:</includeonly>Template}} always should have. I.e. it expands the template even when it is being included in a template that does not get subst:d. In other respects {{subst:subst:Template}} acts exactly like {{subst:Template}} The alternative way to fix this would be to add a new magic word, this would, in my opinion, be less easy for editors to remember. (That said we don't seem to care much about the usability of template-wikitext).
Since safesubst: was added in r61710. You will be able to use "safesubst:" instead of "subst:" in templates that require transcluded substitution to work, while still being able to use subst: for cases where the template wants to know if it has been subst:d. http://en.wikipedia.org/wiki/Help:Substitution#safesubst:
Reverted by Tim in r62689. Branched to http://www.mediawiki.org/w/index.php?title=Special:Code/MediaWiki/path&path=%2Fbranches%2Fconrad
Sorry, this particular change was not reverted by Tim, and is in 1.16beta.