Help talk:Transclusion/Archive 2
This is an archive of past discussions about Help:Transclusion. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 |
Transcluding only on the first calling page
I've got a MediaWiki that has a template which is meant to be included onto a page of type 'A'. Then pages of type 'A' are transcluded onto page 'B', which is a category holder (it lists all of type 'A'). In the template I have [[Category: Type A]]. Because of the transclusion, this gets included (and tags the page) for all of 'type A' pages and also the 'type B' category page. So I want to find a way to have the template only include the [[Category: Type A]] on 'type A' pages and not 'type B' pages.
The pages are not designed in such a way that using pagename tricks will work; I tried this with Module:String and ran out of memory on the page renders because of the excessive number of calls. Is there a way to have a template pass <noinclude>[[Category:Type A]]</noinclude> literally up to the calling page, such that it will then be interpreted by any further transclusion as a noinclude?
Thanks! Ibanix (talk) 22:35, 11 March 2016 (UTC)
Transclude a Wikipedia template from Commons
I want to transclude a English Wikipedia template from Commons.
What markup should I use? — Preceding unsigned comment added by Luis150902 (talk • contribs) 09:42, 11 October 2015 (UTC)
- @Luis150902: The software doesn't allow that, I'm afraid. You will have to find or create an equivalent template on the project where you are planning to use it. -- John of Reading (talk) 10:03, 11 October 2015 (UTC)
- @John of Reading and Luis150902: An interwiki transclusion feature was proposed in 2008, but it has not yet been implemented. Perhaps the GlobalUserPage extension could be modified to allow this. Jarble (talk) 05:33, 28 May 2016 (UTC)
- @John of Reading and Luis150902: A feature called "scary transcluding" already makes this possible, but the current implementation is very inefficient (and therefore disabled on most wikis). Jarble (talk) 17:25, 1 June 2016 (UTC)
Section transclusion error
I'm having trouble sorting out what I've done wrong when trying to transclude a section on List of United States Army military equipment of World War II. The section on Small arms currently contains a transclusion which displays correctly if you edit and then "Show Preview", but doesn't display correctly on the full page. Any ideas what is doing on here? Klbrain (talk) 18:02, 15 March 2017 (UTC)
- It looks right to me. What is the perceived problem? PrimeHunter (talk) 18:27, 15 March 2017 (UTC)
Black magic seems to have fixed it, as I no longer generate the error I saw. Thanks for looking, PrimeHunter. It may have been my cache problem (although I thought I had checked it with 3 browsers on 2 computers), or some error of mine. Agree that it looks fine now. Klbrain (talk) 22:02, 15 March 2017 (UTC)
- Maybe it needed a server purge at the time. PrimeHunter (talk) 22:16, 15 March 2017 (UTC)
Semi-protected edit request on 29 September 2017
This edit request to Wikipedia:Transclusion has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
fix this: sustitutes --> substitutes 82.135.219.67 (talk) 09:45, 29 September 2017 (UTC)
- Done. Thanks. PrimeHunter (talk) 09:53, 29 September 2017 (UTC)
Collapsing transclusion
How do you collapse a transclusion on a page? No method I've tried has been successful because the collapse also included everything on the page that came after the transcluded content. This was a fail:
- ==Title of transcluded page==
- {{cot|title=Transclusion from Talk:Article Title : January - February 2017}}
- {{Talk:Article Title}} (← the transclusion template)
- {{cob}}
What am I missing? Or can it not be done? Thanks! Pyxis Solitary talk 06:00, 26 October 2017 (UTC)
- PLease give a link(s) to the page where you have been trying this. --Redrose64 🌹 (talk) 09:25, 26 October 2017 (UTC)
- @Redrose64: Sorry that I did not reply sooner. I did not receive any notification that my comment had been replied to. The page and section is:
- The history of the GA process was transcluded and should remain on the article's talk page for editors that may be interested in what it entailed. I thought it could be collapsed, as I've done with content in my profile page. Pyxis Solitary talk 08:48, 3 November 2017 (UTC)
- @Pyxis Solitary: Once a GA review is finished (whatever the outcome), the normal thing to do is to de-transclude it. If people want to read it later, it's linked from one of the boxes at the top of the talk page - in this case, it's the one which begins "Carol (film) has been listed as a Media and drama good article" and the link to the GAR page is where it says "Review". --Redrose64 🌹 (talk) 20:56, 3 November 2017 (UTC)
- Something, maybe an open tag, in Talk:Carol (film)/GA2 interferes with the code to start and end the collapsing. Something also goes wrong if you try to insert {{cot}} and {{cob}} at the top and bottom of Talk:Carol (film)/GA2 so the issue is not related to transclusion. {{cot}} and {{cob}} work correctly around other transcluded pages. PrimeHunter (talk) 23:28, 3 November 2017 (UTC)
- @Redrose64: I didn't know the "Review: August 7, 2017." took you to the whole shebang. Another one of those instances on Wikipedia, for me, where if something is not made crystal clear why it's there, I don't see it. For others who share the same ???, I'm going to add a comment about it in the Talk page so they know how to find the review. Pyxis Solitary talk 23:45, 3 November 2017 (UTC)
- @PrimeHunter: Thank you for taking a look. I wonder where the culprit is. Pyxis Solitary talk 23:45, 3 November 2017 (UTC)
- At Talk:Carol (film)/GA2, there is some horrific HTML: for instance,
<ol>
tags that are not immediately followed by (optional whitespace and) a<li>
tag; closing tags at a different nesting level than the corresponding opening tag - if one exists. You can't just drop HTML tags in and hope that they work; they need to have an organised and properly nested structure. --Redrose64 🌹 (talk) 00:09, 4 November 2017 (UTC)
- At Talk:Carol (film)/GA2, there is some horrific HTML: for instance,
- @PrimeHunter: Thank you for taking a look. I wonder where the culprit is. Pyxis Solitary talk 23:45, 3 November 2017 (UTC)
- @Pyxis Solitary: Once a GA review is finished (whatever the outcome), the normal thing to do is to de-transclude it. If people want to read it later, it's linked from one of the boxes at the top of the talk page - in this case, it's the one which begins "Carol (film) has been listed as a Media and drama good article" and the link to the GAR page is where it says "Review". --Redrose64 🌹 (talk) 20:56, 3 November 2017 (UTC)
Excluding from transclusion.
Hi, individual review pages are currently transcluded to WP:MHR. I believe the individual review pages are created by a boilerplate. Is there an easy way to to mark the boilerplate to exclude certain text from transclusion? If you go to the linked page, you will see that the "toolbox" is repeated for every page because it has been transcluded from every review page. Thankyou in advance. Regards, Cinderella157 (talk) 12:43, 27 January 2018 (UTC)
- The toolbox has links for the article in that section so it's not redundant to display it for every article. There are several ways to omit it but why do it? One of the ways is to use
<noinclude>...</noinclude>
around {{Wikipedia:Featured article tools}} in Wikipedia:WikiProject Military history/Review/A-Class review preload boilerplate. This would only affect review pages created in the future. PrimeHunter (talk) 17:15, 27 January 2018 (UTC)
- @PrimeHunter it is a solution to another problem, of which the toolbox is a good representation. Thankyou. Regards, Cinderella157 (talk) 00:23, 28 January 2018 (UTC)
Excluding images?
Is it possible to exclude images from a section transclusion using {{#section-h:PAGENAME|SECTIONNAME}}? If so, how is it done? (please ping with reply), Cheers, · · · Peter (Southwood) (talk): 16:36, 3 June 2018 (UTC)
- Use noinclude tags. Seppi333 (Insert 2¢) 17:29, 3 June 2018 (UTC)
- @Pbsouthwood: Sorry, I didn't ping you before. Seppi333 (Insert 2¢) 23:31, 3 June 2018 (UTC)
- Thanks Seppi333, That should work. I should have thought of that, but like many things it is more obvious after you notice it. Cheers, · · · Peter (Southwood) (talk): 05:49, 4 June 2018 (UTC)
- PS: Works fine. Thanks, · · · Peter (Southwood) (talk): 10:46, 16 June 2018 (UTC)
- Thanks Seppi333, That should work. I should have thought of that, but like many things it is more obvious after you notice it. Cheers, · · · Peter (Southwood) (talk): 05:49, 4 June 2018 (UTC)
Broken sub-section header formatting
{{#section-h:PAGENAME|SECTIONNAME}}
does not correctly format subheaders if they are the first line of code in a transcluded section. The transcluded content has the wikicode (===) visible. Is this a thing that should be fixed, and is there an invisible workaround? Please ping me in reply. Cheers, · · · Peter (Southwood) (talk): 07:30, 16 June 2018 (UTC)
- @Pbsouthwood: Works for me. On which page are you seeing this? --Redrose64 🌹 (talk) 09:30, 16 June 2018 (UTC)
- Redrose64, There are some cases on Portal:Underwater diving, at Index to diving related organisations articles and Index to diver training, registration, certification and standards articles (in a collapsible list in both cases) The second case mentioned is also displaying with a large gap, which may or may not be related. Copied below for your convenience. Cheers, · · · Peter (Southwood) (talk): 10:38, 16 June 2018 (UTC)
- Further testing shows that it works fine outside of the collapsible list, so it looks like there may be an interaction problem. I have no idea which one is the cause. · · · Peter (Southwood) (talk): 10:43, 16 June 2018 (UTC)
- I think that this is a general problem with template parameters, in that they cannot start with certain kinds of markup, including headings. Try inserting
 
, that is, alter the line toThis character is a soft space, in a form which will be passed through to your browser unchanged by MediaWiki and Tidy; your browser will dispaly a space. --Redrose64 🌹 (talk) 11:14, 16 June 2018 (UTC)|  {{#section-h:Outline of underwater diving | Diver training, certification, registration and standards }}
- ThanksRedrose64, I will try this. · · · Peter (Southwood) (talk): 06:25, 17 June 2018 (UTC)
- It does the trick. I would not have guessed this one. Is there an explanation of this anywhere that you know of, and a listing of what kinds of markup at the start will confound a template? Cheers, · · · Peter (Southwood) (talk): 11:43, 17 June 2018 (UTC)
- Section heading code like === Diver training === normally has to be at the beginning of a line. All such code can cause problems in templates, sometimes because the software overcompensates and acts like it is at the beginning of a line when the user doesn't want it. PrimeHunter (talk) 13:40, 17 June 2018 (UTC)
- It does the trick. I would not have guessed this one. Is there an explanation of this anywhere that you know of, and a listing of what kinds of markup at the start will confound a template? Cheers, · · · Peter (Southwood) (talk): 11:43, 17 June 2018 (UTC)
- ThanksRedrose64, I will try this. · · · Peter (Southwood) (talk): 06:25, 17 June 2018 (UTC)
- I think that this is a general problem with template parameters, in that they cannot start with certain kinds of markup, including headings. Try inserting
- Further testing shows that it works fine outside of the collapsible list, so it looks like there may be an interaction problem. I have no idea which one is the cause. · · · Peter (Southwood) (talk): 10:43, 16 June 2018 (UTC)
Please edit Sonia Fergina back to 1993 that is the same as all anonymous blocks that vandalize my edits!
Please I ask to open the protection. I want to edit it back to the right one. Because I have a reference. And all this anonymous blocking 142,167,242,182 same then protek again and also block the user named oshwah. Muhammad Ammar Baasir Kalashnikov (talk) 13:32, 11 August 2018 (UTC)
- @Muhammad Ammar Baasir Kalashnikov: this is the talk page for discussing improvements to the page Wikipedia:Transclusion. Requests for changes to page protection level should be made at Wikipedia:Requests for page protection. --Redrose64 🌹 (talk) 19:54, 11 August 2018 (UTC)
Is transclusion as wrapped in <code><nowiki></nowiki></code> possible?
This help request has been answered. If you need more help, you can , contact the responding user(s) directly on their user talk page, or consider visiting the Teahouse. |
Suppose, there are pages Template:Foobar, Template:Foobar/doc (with documentation), and Template:Foobar/example, which is a demonstration of the template's usage. Is it possible to transclude the code of /example as if it was wrapped in <code><nowiki></nowiki></code>
into the /doc page?
So, if page Template:Foobar consists of is Hello, World!
, /doc page is Use Foobar to say hello to the world.
, and page Template:Foobar/example is "some text before" {{Template:Foobar|param1|param2|...}} "some text after"
, I want to be able to add a section "Example" to /doc page, which would transclude the code of /example, and the wikimarkup result in the /doc page is <code><nowiki><!-- whole code of /example appears here --></nowiki></code>
. —andrybak (talk) 09:10, 21 August 2018 (UTC)
- Yes, I do it at m:User:Redrose64#Geonotices; specifically, it is the transclusion modifier
msgnw:
(see mw:Help:Magic words#Transclusion modifiers) - this does the<nowiki>...</nowiki>
but not the<code>...</code>
- I added my own. --Redrose64 🌹 (talk) 11:47, 21 August 2018 (UTC)- Thanks! This is exactly what I needed. Now the only thing left to do is figure out how to format it as if it was inside
<pre>...</pre>
— perhaps something like<div style="font-family:monospace;font-size=14pt">...</div>
would work. —andrybak (talk) 14:05, 21 August 2018 (UTC) - In cases anyone stumbles upon this:
{{msgnw:…}}
"wraps" the transcluded code in only one pair of<nowiki>...</nowiki>
. Use Template:Pre around{{msgnw:…}}
to format the transcluded code as code (same thing that<pre>...</pre>
does, which can not be used around{{msgnw:…}}
), like this:The{{pre| {{msgnw:Example}} }}
<div>...</div>
solution suggested above will only change the font, but will mangle the line breaks. —andrybak (talk) 15:35, 21 August 2018 (UTC)
- Thanks! This is exactly what I needed. Now the only thing left to do is figure out how to format it as if it was inside
Obtuse and proud of that?
I'm reasonably intelligent and have edited WP for several years now. But my eyes glaze over and my brain fogs up whenever folk start talking about Transclusion. They delightedly refer readers to this impossibly obtuse page as if "Transclusion" is here made perfectly clear. It is not, starting with the opening definition. The word is a clever mangling of words that replaces some simpler terminology. Fair enough -- many words start that way. But please give us a clue.
When an editor scolds you to not transclude something in a document, what does the editor mean? How does one avoid committing this error?
"Transclusion means the inclusion of the content of one document within another document by reference."
-- HUH? What the foo does "by reference" mean? Reference to what? Surely this can be defined more clearly. It is a shortcut that places the same template, graphic or boilerplate text into multiple documents, right? Does Transclude have some useful synonyms? What is the origin and history of the term?
The graphics are foo useless. Nor is the article helpful when it chronically repeats the (un)defined word in endless examples. That is like yelling louder at a person who speaks a different language.
In other words, while it is o.k. to write something for folk who like to go deep into the weeds, fine. But first just fill in the basics, and don't use language known mostly to geeks and coders. Please help the chastised who have been sent to this page so that they can quickly make a graceful and semi-informed exit.
NOTE: I first posted this in talk a few weeks ago, with no response, and so I've revised this message and posted a please clarify note on the page itself.
Thanks GeeBee60 (talk) 18:08, 20 December 2018 (UTC)
- It's not at all clear what you are asking for. But if you are asking for authority to do this, I have reverted it since it is a mess. That is not how to transclude a template, least of all the
{{Confusing}}
template. The template's documentation has information on proper usage, with several examples. --Redrose64 🌹 (talk) 08:59, 21 December 2018 (UTC)- User talk:Redrose64, I fail to see how using the
{{Confusing}}
template here is a "mess". Transclusion is poorly defined and explained. My request was confined to a tidy little template box created for the purpose of identifying problems. I reiterate -- what does this mean: "Transclusion means the inclusion of the content of one document within another document by reference."? What does "by reference" mean?? Please reread my above lament. If{{Confusing}}
is not the clearest most logical way of bringing this concern into the open -- after waiting several futile weeks for a reply on the talk posting -- I'm open to a better suggestion. Calling the request a mess helps nothing. - I've been editing for five years, and am tired of seeing editors intermittently scolded for transcluding something and being given no helpful advice, only directed to a long confusing badly constructed muddle. Rather than instantly reverting my request for a better definition and denigrating my request, how about letting the request stand, and instead acknowledge that there might be a problem. I await your reply. Failing a satisfactory one I shall again insert the
{{Confusing}}
template. GeeBee60 (talk) 11:17, 21 December 2018 (UTC) - OK, I'm being a grump, but Transclude is a newly enough invented word that it is not defined in the dictionary that comes with my computer, nor in most online dictionaries. It is a term only used by computer coders and a subset of Wikipedia editors. When directing someone to NOT transclude something, what is meant? "That is not how to transclude a template, least of all the
{{Confusing}}
template." We are speaking different languages, except that I'm pretty sure that I've just been called an ignorant fool. I'm more than willing to meet someone halfway to help rewrite this. GeeBee60 (talk) 17:50, 21 December 2018 (UTC)- GeeBee60, I will try to explain. If I get it wrong, please anyone correct me, but I am not trying to be technically accurate, just to clarify the concept a little.
- When you put the double braces {{ }} around a page name, the software reading the wiki code and converting it to html will recognise that you wish to add the content of the named page at that point, and will go read it, convert it to html and add it at that point before continuing with the rest of the original page. That is transclusion. You refer to the page to be transcluded by namimg it in braces, which is the referencing. There are tricks to exclude parts of the transcluded page, and ways to transclude part of a page, like just a section, but that does not change the basic concept.
- Also important, is that a transcluded page may also include transclusions of other pages. This can be done a moderate number of times, with one page transcluding others, which may each tranclude others, and again and again. There is a limit to how many levels of transclusion are allowed to prevent accidental or intentional infinite loops, which tend to gum up the works.
- Does this help? Please ping with reply. Cheers, · · · Peter (Southwood) (talk): 20:02, 21 December 2018 (UTC)
- @Pbsouthwood: Thanks for the thoughtful explanation, which is getting closer to what I'd like to see re the article. But the question remains, did my using the
{{Confusing}}
template really make a mess of things? Or is it simply an irritation that the clarity of the article is being challenged. I find it amusing how the same template can stand for years in countless articles, but last only a couple of hours here. Again, thanks for the reply. -- GeeBee60 (talk) 20:29, 21 December 2018 (UTC)- GeeBee60, When I read the lead it makes sense to me, So I would not call it confusing. Obviously it does not make sense to you, or you would not have tagged it. Yes, it is a new and specialist word, but that is why there is a whole article explaining it in detail. I don't quite understand what it is that you don't understand about it, and that makes it difficult for me to suggest improvements. If you want to try to work through this by proposing a better alternative I will try to assist, but this is Wikipedia, and so can anyone else, and the final product may still not be what you think is best. To a large extent, getting an improved version will depend on how well you can explain where your confusion lies, so those who find it clear can understand your point beyond just knowing that it exists. Another possible outcome, if you can come up with a very simple explanation, would be to put it in Simple English Wikipedia, where it would be an alternative explanation linked from the sidebar on other Wikipedias. I am going to post my little explanation above on simple, as the article does not exist yet, in the hope that a clear and simple explanation may be developed there. You are welcome to assist. Cheers, · · · Peter (Southwood) (talk): 05:34, 22 December 2018 (UTC)
- There is now a stub on simple, take a look and see if it makes sense to you. · · · Peter (Southwood) (talk): 06:08, 22 December 2018 (UTC)
- The mess may refer to your use of triple braces in the tag, which I do not understand. (One might say it is confusing;-P)· · · Peter (Southwood) (talk): 06:03, 22 December 2018 (UTC)
- It's a mess because in this edit, where you added this code: you didn't transclude
{{Confusing|article lede | reason = {{{reason|the definition is confusing.}}} | date = {{{12/20/18|}}} }}
{{confusing}}
according to its documentation, you appear to have added extra nonsensical code the reason for which escapes me. For instance, what is{{{12/20/18|}}}
supposed to achieve? It does nothing useful. --Redrose64 🌹 (talk) 09:33, 22 December 2018 (UTC)
- It's a mess because in this edit, where you added this code:
- GeeBee60, When I read the lead it makes sense to me, So I would not call it confusing. Obviously it does not make sense to you, or you would not have tagged it. Yes, it is a new and specialist word, but that is why there is a whole article explaining it in detail. I don't quite understand what it is that you don't understand about it, and that makes it difficult for me to suggest improvements. If you want to try to work through this by proposing a better alternative I will try to assist, but this is Wikipedia, and so can anyone else, and the final product may still not be what you think is best. To a large extent, getting an improved version will depend on how well you can explain where your confusion lies, so those who find it clear can understand your point beyond just knowing that it exists. Another possible outcome, if you can come up with a very simple explanation, would be to put it in Simple English Wikipedia, where it would be an alternative explanation linked from the sidebar on other Wikipedias. I am going to post my little explanation above on simple, as the article does not exist yet, in the hope that a clear and simple explanation may be developed there. You are welcome to assist. Cheers, · · · Peter (Southwood) (talk): 05:34, 22 December 2018 (UTC)
- @Pbsouthwood: Thanks for the thoughtful explanation, which is getting closer to what I'd like to see re the article. But the question remains, did my using the
- User talk:Redrose64, I fail to see how using the
- Pbsouthwood, Redrose64, thanks. Since I hate admitting error let me get that out of the way first. I rarely use braces and insert templates, as IMHO cleanup templates are overused and WP would be better served if they had an expiration date. This reluctance is my excuse for a lack of expertise, though mule-headedness and age creep are more plausible. For whatever reason I was sure there were some triple braces in the example I drew from and, sigh, I messed up.
- Moving on, thank you Pbsouthwood for the "Simple English" version. I'll sleep on it and reread it. As for problems with the existing definition etc., here are four specific concerns:
- 1) The first defining sentence that ends "by reference" is incomplete. By reference to what? One refers to a game seen, a meeting attended, s job completed, a book read, etc. I could rewrite this as " "Transclusion means the inclusion of the content of one document within another document by [using a] reference [shortcut]." I stumble over that and so to help me try to comprehend this, I wrote an alternative definition:
"Transclusion is a computer shortcut that inserts an identical document, such as a template, a graphic, a section of text, or an entire document, into multiple documents. In Wikipedia, each document for insertion has a reference name and the document appears (is transcluded) whenever its reference name– surrounded by double braces- is used in another document." (by GeeBee60 12/19)
- Do I interpret the meaning of transclusion correctly, or does my definition miss the meaning? It seems equally, if not more, important to clarify the effects of the double braces and that done, the meaning of transclude will catch up.
- 2) I expressed concern that missing from the definition is the word's etymology -- when and from what was it coined. Also missing are synonyms for the word.
- 3) I have problems with "examples" such as "*
{{Like}}
will transclude from the page Template:Like ( Like)" This is not so much an example as it is a statement. In defining terms, one should also use synonyms. I'd further contend that an example would actually describe what happens. - 4) I (and others) have also criticized the graphic table of foo. Foo is a meaningless term that casts considerable confusion. I'll see if I can create an alternative.
- Enough for now, thanks -- GeeBee60 (talk) 20:30, 22 December 2018 (UTC)
- Oh, 12/20/18 was supposed to be a date? You put it in the position that a parameter name would have taken. Wikipedia has a number of restrictions on valid date formats, see MOS:DATE. For example, we never shorten years to two digits because of ambiguity, and we never use all-numeric dates except where they match the YYYY-MM-DD format as specified by ISO 8601. I suppose that you intended it to mean 20 December 2018. But in cleanup templates, we never use the exact date, just the month and year. So you should have put
|date=December 2018
. As for Foo, it's a deliberately meaningless term, but it is in common use, see Foo - please don't try to create an alternative, this will only cause more confusion. --Redrose64 🌹 (talk) 10:27, 23 December 2018 (UTC)- When I have something I'll post it. Look I already agreed that I messed up the
{{Confusing}}
template. But if this page were clearer and the instructions elsewhere were clearer I would not have posted this and all the follow-up. As for Foo, it is a made up term that computer programers use, and therefore this graphic violates the stated WP purpose of employing clear non-jargon language. The Foo article itself admits that Foo's relation to FUBAR is speculation, and I repeat, Foo is not helpful, only distracting and confusing unless you happen to be a programmer. GeeBee60 (talk) 01:56, 24 December 2018 (UTC) - I see that someone just edited Wikipedia_talk:Transclusion#Please_add_clearer_real_example_text the first Talk section here, written 2014. This has since been reverted and I agree -- one does not rewrite someone else's talk entry, especially four year old ones. But the original 2014 concern and mine have much in common, with little resolution in between.
- A side note that my confusion is somewhat allayed when I read Transclusion, where it is more clearly defined, vs Wikipedia:transclusion. While these are purposefully two articles, they need to be less independent and dissonant, more companionable. I confess that only now am I reading them side by side. Thanks GeeBee60 (talk) 12:48, 2 January 2019 (UTC)
- When I have something I'll post it. Look I already agreed that I messed up the
- Oh, 12/20/18 was supposed to be a date? You put it in the position that a parameter name would have taken. Wikipedia has a number of restrictions on valid date formats, see MOS:DATE. For example, we never shorten years to two digits because of ambiguity, and we never use all-numeric dates except where they match the YYYY-MM-DD format as specified by ISO 8601. I suppose that you intended it to mean 20 December 2018. But in cleanup templates, we never use the exact date, just the month and year. So you should have put
Articles now transclude themselves?
I happened to notice last night that if you check "What links here" on (all? many? most?) mainspace articles, they now report that they transclude themselves.
...but not all articles: disambiguation pages, for example, do not seem to exhibit this behavior.
Examples (below are links to "What links here" / "Hide links"):
- Dischord Records says it transcludes itself
- The Discord dab page does not
- (...but it does note that Discord (song) transcludes itself)
- Nor does WP:Discord
This seems like a new(-ish) bug in the Mediawiki engine, or is there a logical reason for this behavior that I'm missing?--NapoliRoma (talk) 20:07, 2 June 2019 (UTC)
- Some templates or modules use transclusion of the page they are on to look for information in the wikitext like how to format dates. Dischord Records does it via {{Cite book}}. PrimeHunter (talk) 20:56, 2 June 2019 (UTC)
- This is Help talk:Citation Style 1/Archive 55#Self transclusion. --Redrose64 🌹 (talk) 21:01, 2 June 2019 (UTC)
- OK, thanks! Good to know there's an explanation.--NapoliRoma (talk) 21:10, 2 June 2019 (UTC)
Selective transclusion using excerpts
The section on selective transclusion is quite complex. However, now there's the Template:Excerpt which wraps and "hides" most of this complexity to the user. Therefore, this section could be rewritten and simplified greatly by referring more to the template. I may try such a rewrite myself in a few days, but until then I leave this here in case someone wants to comment or take the lead. Sophivorus (talk) 14:47, 13 November 2019 (UTC)
- Hi again! I just requested a grant to improve and spread excerpts in the English Wikipedia and five other wikis. If anyone is interested and would like to leave a comment in the grant's page, it would be most welcome. Thanks! Sophivorus (talk) 21:58, 13 December 2019 (UTC)
Requested move 11 August 2020
- The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this discussion.
The result of the move request was: moved with redirect left behind. —usernamekiran (talk) 19:26, 18 August 2020 (UTC)
Wikipedia:Transclusion → Help:Transclusion – Should this page be in the help namespace instead of the project namespace? It looks to me like the page provides mostly functional explanation. Bsherr (talk) 13:33, 11 August 2020 (UTC)
- Support, this is definitely a help page, rather than policy/guideline or essay. --Jules (Mrjulesd) 22:04, 11 August 2020 (UTC)
- Support. Yes, this makes sense. Though this should stay as a redirect, of course. Largoplazo (talk) 13:35, 13 August 2020 (UTC)
- Strong support. Should be moved without a redirect. --ThesenatorO5-2argue with me 11:43, 15 August 2020 (UTC)
- @ThesenatorO5-2:
without a redirect
What do you suggest the current name be then? Nardog (talk) 18:07, 18 August 2020 (UTC)
- @ThesenatorO5-2:
- Support move, leaving a redirect (many links would otherwise be broken). —Mdaniels5757 (talk • contribs) 17:57, 18 August 2020 (UTC)
- The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Selective transclusion of sections with many references causes a high "transclusion expansion time"
I noticed problems with transcluding sections with many references and/or much content − it seems like this quickly causes the page to exceed the "post-expand include size"-limit. Even without transcluding sections the "Transclusion expansion time report" shows very long load-times. I'm not sure why Transclusion expansion takes long even though no sections are transcluded: are reference-templates transclusions? Maybe somebody here knows more about it − I asked about it here: Necessity of the "post-expand include size"-limit, identifying the core problem and possible alternative solutions. (If possible please answer there or at the phabricator issue, thank you.)
Repeat references in transcluded sections
I just came across a situation with a footnote error in an article selectively transcludes a section from another article. The reason is that the transcluded section included a repeat citation, <ref name=vnat2011/>, where the full reference appeared elsewhere in the original article and wasn't available to the transcluding article. I fixed this by moving the full reference in the source article to the section being transcluded.
Should this page alert editors to check sections they intend to transclude for repeat citations? Largoplazo (talk) 11:51, 13 August 2020 (UTC)
- YES! --Moxy 🍁 13:03, 13 August 2020 (UTC)
- Yeah, selective transclusion can be hinky in the best of circumstances. older ≠ wiser 13:29, 13 August 2020 (UTC)
- @Moxy: I have the same problem, I think, here, Investigations into the origin of COVID-19 (albeit with a fair bit more sources). Is the above "moving the full reference in the source article to the section being transcluded" the only method? RandomCanadian (talk / contribs) 00:37, 25 March 2021 (UTC)
- Yes (the page should say that), and no (not the only method); you can use WP:LDRs. And yes (hinky). Mathglot (talk) 10:53, 25 March 2021 (UTC)
- @Moxy: I have the same problem, I think, here, Investigations into the origin of COVID-19 (albeit with a fair bit more sources). Is the above "moving the full reference in the source article to the section being transcluded" the only method? RandomCanadian (talk / contribs) 00:37, 25 March 2021 (UTC)
Should a subpage be used for a common section?
The section Pages with a common section states "This third page may be a page in its own right or a subpage of either of the other two", however Wikipedia:Subpages states that "Using subpages for permanent content that is meant to be part of the encyclopedia" is a disallowed use. Which of these is correct? AquitaneHungerForce (talk) 07:46, 21 March 2021 (UTC)
- I think page is outdated in some aspects, and I think that that use is no longer performed. But it's more of a technical help page, telling what you could do with the software. But in general you should defer to policy pages for what is allowed. --Jules (Mrjulesd) 19:02, 21 March 2021 (UTC)
- I was wondering the same thing, and considering just placing the common text into a simple template, with no parser functions; strictly as as simple way to slurp the content. Is there any reason not to do it this way? Mathglot (talk) 10:55, 25 March 2021 (UTC)
- I might be wrong, but I'm not aware of any rules forbidding this. But a more usual way of doing this would be to use Help:Transclusion#Selective transclusion. --Jules (Mrjulesd) 11:51, 26 March 2021 (UTC)
Transcluding specific versions or sections thereof?
A prior unanswered question--from a dozen, whoa, from nearly thirteen years ago:
Transclude articles with permalinks
Is there a way to transclude articles with permalinks, so if we transclude with a permalink the article that gets included has always the same version?153.96.133.33 (talk) 12:45, 1 October 2008 (UTC)
I'll reword:
- Is there a way to transclude a specific version of a page or section thereof?
—CmdrDan (talk) 10:00, 17 August 2021 (UTC)
- @CmdrDan:, I'm about 90% sure the answer to this is "no", but I believe Izno will be able to give a definitive answer. Mathglot (talk) 10:17, 17 August 2021 (UTC)
- See Wikipedia:Village pump (technical)/Archive 191#Can section transclusion be made to work with old version permalinks? - in brief, no, and it would be extremely difficult. --Redrose64 🌹 (talk) 14:19, 17 August 2021 (UTC)
- @CmdrDan:, here's sort of side-aspect of your question: What happens if you look at an old version of an article, say, ex-US President George H.W. Bush for example, which transcludes the template {{US Presidents}}, and then you check who is the last President listed by the transcluded template in the old version? Will it be the President at the time of the old revision, or will it be the President now? Have you got your answer in mind? Okay, have a look at the "George H.W. Bush" article revision of 6 October 2008. Note that the first sentence of that revision lists Bush as still alive in 2008 (he died in 2018). That's because an old revision shows the old text that was there at the time. Now scroll down to the Nav bar "Presidents of the United States" near the bottom, and check who is listed as the most recent President. The old revision shows Joe Biden last; that's because it transcludes the current revision of the template. That's not a proof, but sort of an indicator of one of the difficulties that would be involved in transcluding specific revisions of templates. And an article can have dozens, or hundreds, of transclusions. Mathglot (talk) 06:07, 20 August 2021 (UTC)
- Ouch. Ok.
- @Mathglot Yes, I see your point: A consequence of the power of transcluding vis-à-vis permalink (looks like I'm not the only one who thinks of these as a permlink [sic.]) is that a true "time machine" function will have to recursively call appropriate versions of all transcluded content.
- In your example: "George H.W. Bush" article revision of 6 October 2008 I count 290 "Pages transcluded onto the current version of this page". (What do you call this area, the area below the "Publish changes" "Show preview" "Show changes" buttons--the one that lists:
- "Wikidata entities used in this page"
- "Pages transcluded onto the current version of this page"
- "This page is a member of 42 hidden categories"
- "Parser profiling data"
- In your example: "George H.W. Bush" article revision of 6 October 2008 I count 290 "Pages transcluded onto the current version of this page". (What do you call this area, the area below the "Publish changes" "Show preview" "Show changes" buttons--the one that lists:
- and why is "hidden categories" the only one of these headings that displays the count of entities--ok, "Parser profiling data" doesn't need a count.
- Compare the 290 transclusions in the 6 Oct 2008 version of the article to the current version and you'll find:
- No difference
- I was expecting to see a different number.
- Compare the 290 transclusions in the 6 Oct 2008 version of the article to the current version and you'll find:
Sidebar:Page Information, is creation a revision?
- Page Information tells us there have been 10,154 edits to the George H W Bush page that was created at 23:12, 20 September 2001. Humm...does that mean (10,154 the original); or (10,153 the original)? I thought the former, but if we look at the page info for (see above) permlink: that says two revisions, I mean edits. Humm, indeed.
- Two makes sense if you want to count the number of entries in the history list.
- Rather than make creation a special case let's call creation an edit.
Stop the presses!
- Hold on a second.
- I just noticed that if click on "Show preview" the string changes from:
- "Pages transcluded onto the current version of this page"
- to
- "Templates used in this preview"
- I just noticed that if click on "Show preview" the string changes from:
Show Preview reveals current state of transclusions
- This seems to explain everything.
- Edit the 19th revision of the George H. W. Bush the one edited at 09:09, 22 August 2002 by JeLuF and appreciate that at the bottom of the page you'll see "Pages transcluded onto the current version of this page (help):" [emphasis added]
- Now click on: Show preview
- Poof, just like that no more, "Pages transcluded onto the …"
- That's because there weren't any transclusions called in this version of the page.
- Now click on: Show preview
- Edit the 19th revision of the George H. W. Bush the one edited at 09:09, 22 August 2002 by JeLuF and appreciate that at the bottom of the page you'll see "Pages transcluded onto the current version of this page (help):" [emphasis added]
- Jumping ahead six years:
- Editing the 6 October 2008 version of George H. W. Bush
- Click Show preview
- Bingo!
- Not 290, now it's 141 templates used in the preview.
- Jumping ahead six years:
- Sure seems like clicking on Show preview triggers an examination of the templates on a past version of an article and that unless this happens we're always looking at the current state of transclusion.
- I'm not qualified to answer this question, but it feels like there's a lot more work involved in assembling all of the transclusions invoked on a specified as we have to recursively search each template's history. A lot of work, but possible to do. The question is: is there any need for this?
When is a Permalink not a true rendering? Frequently.
- I'd say, unless this recursive transclusion is performed we're not delivering on what we're saying. We're not really showing you how an article appeared last year, or 19 years ago, we're showing you an approximation--how much of an approximation?
- We don't know.
- —CmdrDan (talk) 04:55, 23 August 2021 (UTC)
onlyinclude and case sensitiveness
I noticed during some recent testing that, for some reason, the onlyinclude tag is case sensitive, while noinclude and includeonly are not (See Module talk:Transcluder for more detail). Is there a reason for this? Just curious. Aidan9382 (talk) 11:57, 20 May 2022 (UTC)
- I don't really know, but I think this is most likely a bug. --Jules (Mrjulesd) 12:53, 20 May 2022 (UTC)
The text disappears?
Why is it that the text in this section is not visible anymore? Is it normal for {{#ifeq:{{{transcludesection|SECTIONNAME}}}| to have this effect? Nehme1499 16:54, 27 May 2022 (UTC)
- @Nehme1499: Ive gone ahead and fixed the issue. The problem was that
{{#ifeq:{{{transcludesection|SECTIONNAME}}}|Final|
was essentially the same as{{#ifeq:SECTIONNAME|Final|
, which it obviously wont. You just needed to replaceSECTIONNAME
with the name of the section (In this case,Final
). Hope this helps! Aidan9382 (talk) 17:10, 27 May 2022 (UTC)- Ahh, gotcha. Thanks. Nehme1499 17:15, 27 May 2022 (UTC)