Template talk:Template sandbox notice
![]() | This template supports Wikipedia:Template test cases. |
![]() | See also WP:WikiProject Templates |
![]() | Templates | |||
|
Sandbox Name Case Sensitivity
[edit]Template:Template sandbox notice does not work when uppercase "S" is used to name the sandbox. See Template:Categorybrowsebar/Sandbox, Template:Case Closed names/Sandbox, Template:AWB Sandbox Heading, and Template:Australia state or territory/Sandbox. Please fix Template sandbox notice so that it will work when uppercase "S" is used to name the sandbox. Thank. Suntag (talk) 17:35, 9 September 2008 (UTC)
- The template supports non-standard "sandbox" names. Try using "subpage-name" value:
<noinclude> {{ Template sandbox notice | subpage-name=Sandbox }} </noinclude><!-- template code goes here -->
Please don't damage our sandboxes
[edit]- This discussion was moved here from the talk pages of User:Suntag and me. --David Göthberg (talk) 12:14, 10 September 2008 (UTC)
Sorry to leave a cranky message here since I know you only meant well, but I have just spent an hour cleaning up after your recent edits to template sandboxes that are on my watchlist.
You added sandbox notices to them that caused several problems:
1: They caused newlines thus breaking the examples.
2: They added code on top of the test templates that doesn't belong there, which makes it much more error prone when we cut and paste the template code into the actual deployed high-risk templates.
I had to fix the newlines you caused and then go around purging the pages that use the sandbox examples. And I removed your sandbox code from the sandboxes of the high-risk templates due to reason 2 above. Those sandboxes already have a clear statement below the test template that they are sandboxes.
So please don't add newlines when you add sandbox notices, and please don't add sandbox notices at all to high-risk templates' sandboxes, and please don't add sandbox notices to sandboxes who already clearly states they are sandboxes.
I only fixed the cases that are on my watchlist. I suggest you check and fix the newlines in the rest of the sandbox edits you have been doing. And don't forget to then purge the pages that use those sandbox examples, or people will think they are broken and spend time trying to fix them.
--David Göthberg (talk) 06:33, 10 September 2008 (UTC)
- Hi David. Your message was not cranky and sorry for any problems I caused. I thought the "noinclude" would prevent my addition from affecting the sandbox. Template:Template sandbox notice instructs to add the template to the top of the sandbox page with the code below. All the pages I added Template:Template sandbox notice were not categorized in Category:Template sandboxes. If you can, please add Category:Template sandboxes to those high-risk templates from which you removed the sandbox code. I'll look over the sandbox pages that I edited. Thanks for the notice. I won't add any more Template sandbox notices. Suntag (talk) 06:44, 10 September 2008 (UTC)
As I explained above adding the sandbox notice causes two problems. Look at these two code examples:
<noinclude>{{Template sandbox notice}}</noinclude> Lots of template code.<noinclude> Perhaps a sandbox explanation or test examples. </noinclude>
<noinclude>{{Template sandbox notice}} </noinclude>Lots of template code.<noinclude> Perhaps a sandbox explanation or test examples. </noinclude>
The first example above causes a newline before the template code. That has big effects on how the template renders in its test examples.
The second example in theory has no negative effects. But once the code is working and a human copies and pastes the code into the actual deployed template it gets tricky. Since then the human must select exactly after the ">" character at the end of the first "</noinclude>" and until the start or end of the second "<noinclude>". That is tricky and error prone and every now and then it results in that faulty code gets copied and pasted into widely used templates.
That is why many of us now code our sandboxes like this:
Lots of template code.<noinclude> Perhaps a sandbox explanation or test examples. </noinclude>
Since that means we can copy and paste whole lines. That is, from the very start of the page until and including the whole line with the first "<noinclude>" tag. (Since we usually want that noinclude in the deployed template.) That reduces the human errors a lot.
And regarding Category:Template sandboxes. I don't see why we should need to categorise our test pages? That is just too much bureaucracy.
Oh, and by the way, I like your username! It gives me several nice associations. :))
Oh, and one more thing: Would it be okay with you if we move or copy this discussion to Template talk:Template sandbox notice? I think this discussion can be interesting for others, even in the future.
--David Göthberg (talk) 07:17, 10 September 2008 (UTC)
- Hi again, David. I'll go through my posts and move all my posts to the bottom of the template and, for those that have a doc page, I'll move it there. I'll remove my posts from any template labeled high risk. Yes, copy this discussion to Template talk:Template sandbox notice. Perhaps we can revise the instructions for that template. Suntag (talk) 07:29, 10 September 2008 (UTC)
Okay, I will copy this discussion there. But before that:
Now that we have tinkered a little with this, here is how I think we can use the sandbox notice in a way that looks good on the pages, works well, and doesn't cause any of the problems I mention above:
Lots of template code.<noinclude> {{Template sandbox notice}} Perhaps a sandbox explanation or test examples. </noinclude>
What do you think about that? It means the sandbox notice gets shown below the template being tested, but before any other explanations or long test examples. So the sandbox notice is still close to the top of the page. But the template being tested/developed is still easy to copy and paste to the main template without much risk for human error.
--David Göthberg (talk) 08:30, 10 September 2008 (UTC)
- That sounds good. I've been moving {{Template sandbox notice}} from the top of the template to the bottom of the template page. Most templates have <noinclude> at the bottom, so I've been putting {{Template sandbox notice}} below that, above {{Documentation}} if it exists. The pages I still need to review are at User:Suntag/sandbox2. I'm going to take a break at the moment. Please feel free to look over the pages. -- Suntag (talk) 08:35, 10 September 2008 (UTC)
End of discussion moved here from the talk pages of User:Suntag and me. --David Göthberg (talk) 12:14, 10 September 2008 (UTC)
- Everyone: As you can see I (we?) are suggesting a new way of placing the sandbox notices. That is, with a noinclude area below the template code, instead of above the template code. Most other things today are placed in a noinclude area below the template code. Having two noinclude areas is confusing. And as I explain above it is more error prone to have the sandbox notices above the template code.
- --David Göthberg (talk) 12:52, 10 September 2008 (UTC)
Suntag: I reverted your latest edits to the documentation for the following reasons:
You and I do agree on that the sandbox notice should go below the template code. But that is a major change to a fairly long standing tradition, so I think we should give people some day to react to our discussion on this talk page.
I liked the improvements of wording you did. "Physically touch" is a very clear way to state it.
I disagree with you about the /doc pages. I think the sandbox notice should be placed on the /sandbox page. That avoids confusion and puts the notice before the documentation instead of in the end of the documentation. Sure, we could put the sandbox notice at the beginning of the documentation like we do with many other notices. But often having the {{documentation}}
tag on the /sandbox version is a mistake and is often later removed or remarked away, thus we would loose the sandbox notice at the same time. Note that there is currently confusion about what /doc page the {{documentation}}
template should show when it is placed on a /sandbox page. If we add sandbox notices in the documentation then we will add to that confusion.
Here is how I prefer we use the sandbox tag when there is documentation too:
Lots of template code.<noinclude> {{template sandbox notice}} {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude>
Yes, it is a lot of space, but it makes it clear what is what and makes copying and pasting less error prone.
And I noticed you did an odd thing with the noinclude tags again. (You used two <noinclude> sections right after each other in some of the examples.) I have seen you do similar things in several places. Either you don't fully understand the includeonly and noinclude logic, or you are just doing mistakes. Either way, be more careful with those. For instance, why did you put this code at the top of the Template:Template sandbox notice/doc earlier today?
<noinclude>{{Template sandbox notice|subpage-name=doc}}</noinclude>
It is somewhat irregular to show a template above its documentation at the /doc page. Did you perhaps mean to use <includeonly> ? But that would also be strange since on the template page itself the template is already visible. Or did you mean to show it on the Template:Template sandbox notice/sandbox? In that case you failed.
Sorry if I am a bit tough on you. I am just pedantic.
--David Göthberg (talk) 16:11, 10 September 2008 (UTC)
- The only people who I am aware that have posted this tempate is User:ConradPino and myself. I just started using the template a day ago and the template was only used on about twenty templates when I started my tagging. User:ConradPino's usage is as I described on the documentation page, so I think all of us are in ageement to some extent. The talk page of this template was not used until I posted to it yesterday. No one else is coming here to comment. Please be bold, revise the documentation page how you think things will work best and I agree in advance to all your changes. I prefer that we resolve this now because I have a ton of prior edits I need to go through and if we wait for additional comments, it is very likely that I won't review my prior posts. Thanks. Suntag (talk)
- That's weird, only 20 uses before you started your tagging? I have seen it used so much over the years that I didn't even bother to check "What links here". Now I checked, and you are right, it is still only used on about 310 pages. Well, I have seen people remove it a lot too. (I myself have often removed it since it disturbed our testing.)
- Okay, so you are right, we can be bold. I'll just get some food and a shower, then I'll get on to update the documentation. That is, reverting back to your version and fixing some minor things.
- --David Göthberg (talk) 17:15, 10 September 2008 (UTC)
- Okay, my revision and extension of the documentation is finished. I hope you'll like it. I had to read the code of the template several times to understand what all the examples meant. There was much more to this template than I knew about. Now I'll get busy with modernising the template's look, see next section.
- --David Göthberg (talk) 18:40, 10 September 2008 (UTC)
WP:Consensus is WP:Policy and as such circumventing Consensus should be avoided. IMO "...if we wait for additional comments, it is very likely that I won't review my prior posts..." is insufficent to justify circumventing Consensus. Other than please seek Consensus using care due the contemplated work, I have no other opinion. – Conrad T. Pino (talk) 19:32, 10 September 2008 (UTC)
- Conrad: Right, that "threat" had no effect on my conclusion that we could be bold in this case. But that Suntag pointed out how little it was used and how infrequently it has been discussed here means for me we can be bold. I checked that it now is only used on about 310 pages and since I have seen that Suntag have added it to lots of pages the last few days I believe him that there probably only were about 20 usage cases before that.
- The documentation for this template badly needed this revision. I believe the very reasons it was so little used was:
- 1: Placing it at the top of the template code caused so much problems that people simply resorted to not using it. At least that is why I have removed it from any template I take care of, and I have seen others remove it for the same reason.
- 2: Since the documentation was unclear people did not understand what functionality the template offers. This template has more functions than one might think. I for one had no idea that one could leave the template in the code when one copied the code to the main template. And the documentation didn't really explain that.
- I hope I have understood correctly how it is intended this template should be used? (Apart from that Suntag and I changed the placement of it from before the template code to after the template code.)
- Oh, and having the sandbox notice below the template code means that the sandbox notice at the same time acts like a natural delimiter between the templates' output and any demonstration or explanation code below them. Thus making the sandbox notice more useful than before.
- --David Göthberg (talk) 20:07, 10 September 2008 (UTC)
- I suggest "...how it is intended this template should be used?" is an indeterminant question as "intent" is subjective and varies by contributer. My intent is lower WP:TESTCASES implementation labor cost and encouraging wide WP:TESTCASES adoption; specifically bidirectional copy/paste (your item 2 above). My reasons are experience based and perhaps obscure. Worse: is template documentation for template users, template authors or both? My conclusion is favor template users since they dominate the contributer population and will probably delete "useless technical gibberish" and "other unnecessary clutter". WP:Consensus implies at best a continiously evolving equilibruim. Thanks you all for contributing. – Conrad T. Pino (talk) 06:43, 11 September 2008 (UTC)
- Well, with "how it is intended to be used" I meant "how did you guys who coded this template intend it to be used", since I expect you to have spent a lot of thinking about how to use it and thus I wanted to tap your expertise. And thanks for your answer, I think I now know how you intended it to be used.
- And regarding documentation: I try to write the documentation like they write school books here in Sweden. (They differ a lot at least from the US university books I have seen.) That is, first a short and simple introduction so the reader gets a general idea what it is about, then more complete examples and explanations that everyone (the template users) are supposed to read and understand. And then I put the "technical gibberish" (for the geeks and template authors) in the "Technical details" section at the bottom, so the regular users know they can ignore it. (In the Swedish school books that usually is in a light blue box with the title "Over course". I tried such a light blue box but it didn't work well in template docs.) This works very well, and so far no one has removed a single character from my "Technical details" sections! While they have been editing the rest of the documentation mercilessly. And I have had such sections in very widely used templates like the {{ambox}} for over a year now. It took me some thinking to come up with a good name for that section, it on purpose was supposed to sound something like "Technical gibberish mostly for the real geeks", and "Technical details" was my choice for it, I think it is clear and succinct and just enough scary to keep out the riff-raff. :))
- --David Göthberg (talk) 10:34, 11 September 2008 (UTC)
- IMO your approach appears sound and I concur; please continue. – Conrad T. Pino (talk) 19:19, 11 September 2008 (UTC)
Change to use ombox
[edit]The "messagebox" class that this template uses is now deprecated and superseded by the "ombox" classes. Thus I intend to change this template to use the standardised {{ombox}}, since this clearly is an "other pages message box". That will not cause any changes in the colours, just slightly improved margins and padding and better box flow (will not overlap or underlap other boxes).
Old box:
New box:
This is the template sandbox page for Template talk:Template sandbox notice. See also the companion subpage for [[../testcases|test cases]]. |
--David Göthberg (talk) 16:30, 10 September 2008 (UTC)
- I have now updated the template to use {{ombox}}, and while I was at it I added an image. The image is not necessary but might add to the instant recognisability of this template.
- --David Göthberg (talk) 20:12, 10 September 2008 (UTC)
Template:Template test cases notice
[edit]Template:Template test cases notice needs to be updated for nonstandard sandbox locations. This should be extended for nonstandard testcase locations. 76.66.196.229 (talk) 09:35, 4 February 2009 (UTC)
- Any thoughts on how bet to do this? I'm a bit leery of trying to change it myself, since I've never messed around with
{{#rel2abs}}
before. 「ダイノガイ千?!」(Dinoguy1000) 22:44, 4 February 2009 (UTC)- Personally, I have no idea... perhaps a question at Village Pump might help? 76.66.196.229 (talk) 07:42, 7 February 2009 (UTC)
- Actually, I was kinda hoping one of the contributors to the template would pipe up... 「ダイノガイ千?!」(Dinoguy1000) 18:00, 7 February 2009 (UTC)
- Personally, I have no idea... perhaps a question at Village Pump might help? 76.66.196.229 (talk) 07:42, 7 February 2009 (UTC)
- OK done in the sandbox; give it a go. I also added the ability to specify nonstandard test case pages to this template's sandbox (mostly because I thought that was what you wanted to start with). This controls categorisation of the test case page. Give that a try too (the test cases are commented out otherwise the testcases page is incorrectly categorised; just uncomment, fix the comments in the test case and run it as a preview). --Rogerb67 (talk) 00:20, 13 February 2009 (UTC)
- Yes, that looks good, perhaps implementation at some point? 76.66.201.179 (talk) 07:52, 13 March 2009 (UTC)
- Done --Rogerb67 (talk) 23:43, 13 March 2009 (UTC)
- Yes, that looks good, perhaps implementation at some point? 76.66.201.179 (talk) 07:52, 13 March 2009 (UTC)
System feature?
[edit]I'm hoping someone can move this notice into the system so that the notice box would be displayed on all template sandbox pages by default without this template being transcluded. Maybe even all sandbox pages. I'm not a developer and am totally ignorant of the issues which might be involved. If you edit this page a mbox is generated at the top of the page without the use of a template. So, it seems that it is technically feasible. –droll [chat] 16:37, 5 July 2010 (UTC)
A request
[edit]I've been working on {{Infobox mountain}}. Its subpage arrangement is different to say the least. It has a number of sub-template sandboxes. Template:Infobox mountain is just a wrapper which provides compatibility with old parameter names. All the real code is at Template:Infobox mountain/main. So the most used sandbox is at Template:Infobox mountain/main/sandbox which works well with this template. The testcases, however, are at Template:Infobox mountain/testcases. Currently, it appears, there is no way to link to these testcases using this template. It expects the testcases to be at ../testcases. The testcases-name option expects the testcases to be at ../<testcases-name>. So could you add a parameter (perhaps testcases-fullname) that would allow a user to specify a page using the full page name. Hope this is understandable. –droll [chat] 23:56, 3 August 2010 (UTC)
why is diff link for 2-page comparator?
[edit]When I started experimenting with template design in my userspace sandbox, another template (apparently {{Template sandbox notice}}) automatically appeared that was not the template I was designing. This unexpected template has a link for a diff, but the diff compares the sandbox revision to my main userspace page. I have no idea why comparing those two pages could be important, or even useful. Am I missing its usefulness or is the template comparing the wrong two pages and therefore it needs reprogramming? Nick Levinson (talk) 15:58, 31 July 2013 (UTC)
- You don't state which page in your userspace you were experimenting with, but I'm guessing that its name ends in
/sandbox
; I'm also guessing the code contains{{documentation}}
. It's a feature of the{{documentation}}
template that if it's used on any page which ends in/sandbox
, the{{template sandbox notice}}
is displayed automatically. You can see it in action at, for example,{{citation needed/sandbox}}
(to name just one of several thousand). --Redrose64 (talk) 16:26, 31 July 2013 (UTC)- You're right (it was my sandbox and had the documentation template), but what about the {{Template sandbox notice}}'s diff link? Is it useful or should it be deleted from this template? I have no idea why we'd compare two different pages just because one is the sandbox and the other is the main user page for the same user. Nick Levinson (talk) 15:04, 1 August 2013 (UTC)
- When a template needs to be amended, and the amendment is non-trivial, it's normal to not edit the "old" version directly, in case it breaks the template (and potentially all the pages which transclude it), but to set up the proposed new version somewhere safely out of the way. As described at WP:TESTCASES, this safe place is typically the
/sandbox
subpage, since that is linked from the bottom of the template documentation box (the part beginning "Editors can experiment in this template's sandbox ..."). When viewing a template's sandbox, the diff link in the{{template sandbox notice}}
is a useful means of comparing old with new. The diff link is not useful in your specific case, since User:Nick Levinson/sandbox is not intended as a new version of the page User:Nick Levinson, but there are many pages where it is useful, so should not be removed. --Redrose64 (talk) 15:27, 1 August 2013 (UTC)- Okay, although, unless my type of case is rare, I wonder if it would help editors if the template tested for which two pages will be compared before offering a diff link, so that the link is provided only where it would fit the situation you describe. But that may be more complicated to set up than I have time for, so maybe this is moot. Thanks. Nick Levinson (talk) 15:41, 1 August 2013 (UTC)
- When a template needs to be amended, and the amendment is non-trivial, it's normal to not edit the "old" version directly, in case it breaks the template (and potentially all the pages which transclude it), but to set up the proposed new version somewhere safely out of the way. As described at WP:TESTCASES, this safe place is typically the
- You're right (it was my sandbox and had the documentation template), but what about the {{Template sandbox notice}}'s diff link? Is it useful or should it be deleted from this template? I have no idea why we'd compare two different pages just because one is the sandbox and the other is the main user page for the same user. Nick Levinson (talk) 15:04, 1 August 2013 (UTC)
Script for syncing
[edit]It'd be nice if there was a script or something that helped make it easier to sync sandboxes to the live version of a template. {{u|Sdkb}} talk 20:09, 27 September 2021 (UTC)
- There is one, but it's buggy - it completely removes
<noinclude>...</noinclude>
blocks, and I think that it also screws input parameters of the form{{{paramname|}}}
. The way that I do it is:- Go to the live template, click on "Edit this page" or "View source", whichever one is third tab along
- Click anywhere in the edit window; press Ctrl+A then Ctrl+C
- Return to the main template page, and in the box at the bottom of the documentation locate the text "this template's sandbox" and click the "edit" link following that
- Click anywhere in the edit window; press Ctrl+A then Ctrl+V
- Click on the edit summary window; enter "synch from live template"
- Click Publish changes
- You're done. --Redrose64 🌹 (talk) 12:21, 28 September 2021 (UTC)
- Well, regarding this (semi) old discussion, I have created a [mirror] link in the Template talk:Template sandbox notice/sandbox. It just, preloads the contents of the base template, using
&preload=
and automatically adds a summary to the page. What do you think? SuperDragonXD (talk) 09:49, 2 December 2021 (UTC)- Replyling to my own message,
preload
doesn't work when there is existing text, so maybe the 'sync' button should link to the main template, and add an edit notice something similar to:- How to sync contents:
- Please press Ctrl + A and Crtl + C, to copy the contents.
- Once you're done, go to the (link: sandbox subpage), and press Ctrl + A then Crtl + V in there.
- What do you think? SuperDragonXD (talk) 00:59, 3 December 2021 (UTC)
- Replyling to my own message,
Template-protected edit request on 3 December 2021
[edit]![]() | This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Change {{Case preserving encode|{{{1}}}}}
to {{FULLPAGENAMEE:{{{1|}}}}}
The {{Case preserving encode}} template doesn't exist anymore, so it should be replaced with {{FULLPAGENAMEE}}
, which encodes the text in a url-safe way.
The code is nested similar to:
{{#if: {{{1|}}} | {{Case preserving encode|{{{1}}}}} | {{NAMESPACEE}}:{{BASEPAGENAMEE}} }}
near the 'diff' code. SuperDragonXD (talk) 00:54, 3 December 2021 (UTC)
Subpage sandbox tagging?
[edit]Is there a way to mark a page as a template sandbox if it is a template subpage's sandbox version? {{Template sandbox notice}}
doesn't seem to support such functionality.
For instance, with this template page set
{{some template}}
{{some template/some subpage}}
{{some template/sandbox}}
{{some template/sandbox/some subpage}}
If I were to use {{template sandbox notice|subpage-name=sandbox/some subpage}}
it would not work, if I were to use {{template sandbox notice|subpage-name=some subpage}}
, the sandbox notice assumes that this is the sandbox for {{some template/sandbox}}
instead of {{some template/some subpage}}
. It seems there should be a way to indicate the template page this is the sandbox to, and possibly indicate it as a template subpage's sandbox
-- 65.92.246.142 (talk) 13:17, 11 March 2022 (UTC)
Mirror link
[edit]Thinking of adding a link to sync the sandbox page, like (diff | mirror). See Template:Template sandbox notice/testcases. Snowmanonahoe (talk · contribs · typos) 03:41, 19 May 2024 (UTC)
- It's not clear to me how this is supposed to work. On the testcases page, the "sync" links merely open up the testcases page in edit mode, with nothing changed. How might I test it properly? --Redrose64 🌹 (talk) 06:51, 19 May 2024 (UTC)
- Oh, yeah, so that's because I'm an idiot and it doesn't work. Snowmanonahoe (talk · contribs · typos) 06:54, 19 May 2024 (UTC)
- Can't work, in fact. Never mind. Snowmanonahoe (talk · contribs · typos) 06:57, 19 May 2024 (UTC)
- Oh, yeah, so that's because I'm an idiot and it doesn't work. Snowmanonahoe (talk · contribs · typos) 06:54, 19 May 2024 (UTC)