Jump to content

Template talk:Documentation/Archive 9

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 01:56, 10 September 2014 (Archiving 1 discussion(s) from Template talk:Documentation) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 5Archive 7Archive 8Archive 9Archive 10

Help with some codes for other wikis

Hi how can I force background colour and the outside box like ja:Template:Documentation/start box please because I would like to add


<div class="template-documentation" style="background-color:#ecfcf4; border:1px solid #aaa; padding:12px;">

This type of bit to a module because some wikis doint have template in there main css so how can I add it to module please. what I means is how can I get it to show the green box to show if the wiki doesent have the css codes for it. 86.135.255.226 (talk) 15:09, 29 March 2014 (UTC)

I had a look into this, and there isn't an easy way to do it right now, as it would require changing both Module:Documentation and Module:Message box. This would be a good feature to develop for the next releases of these modules, but until then the only way of doing this is by copying the relevant parts of MediaWiki:Common.css into your common.css file. — Mr. Stradivarius ♪ talk ♪ 15:59, 29 March 2014 (UTC)
oh ok 86.135.248.121 (talk) 15:38, 6 April 2014 (UTC)

Watching documentation templates

It's irritating that, if I watch a template, I don't automatically watch the related /documentation page. To help alleviate this, would it be possible to add a "watch" link to the existing [view] [edit] [history] [purge] set? Or is there a better solution? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 12:44, 21 April 2014 (UTC)

When I want to watch a page like that I use popups; you can hover over the link and then click the "watch" link under the "actions" menu. Also, I'm not sure a watch link would be useful for most users, but perhaps someone better at CSS/JavaScript than I could tell you how to a customised link to your personal .js or .css pages? — Mr. Stradivarius ♪ talk ♪ 13:01, 21 April 2014 (UTC)
@Pigsonthewing: try this one. it's a bit hackish, but seems to work. you may also be interested in the infoboxgap.js script, which automates the procedure of inserting a numerical gap in an infobox before adding a new field (creates a link to 'infobox gap' in the tools section on the left side). Frietjes (talk) 17:04, 21 April 2014 (UTC)
Thank you. I asked about a script for infobox numbering a while ago and was told there wasn't one; I didn't know that had changed. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:53, 21 April 2014 (UTC)

Duplicate "sandbox" and "testcases" links, please

Could duplicates of the sandbox/testcases links from the...

Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.

...line added at the bottom of the template be included in the title line at the top, please – e.g.

 .... Template documentation   [view] [edit] [history] [purge] [sandbox] [testcases]

...? I think I'd find it convenient and imagine others might too. Sardanaphalus (talk) 10:46, 24 April 2014 (UTC)

I like the idea of having it at the top, but not next to the doc page links. I put an idea of what I want in the sandbox. Mine should probably be made to look prettier, but I like the general concept better. Jackmcbarn (talk) 23:41, 24 April 2014 (UTC)
I also think having links at the top would be useful, as I often find myself scrolling down to find those particular links. If we're going to have something above the heading, though, it shouldn't be a sentence, as that looks out of place to me. Maybe we could add some navigation links to the top right, or maybe we could add a notice completely above the documentation box. More ideas are welcome. :) — Mr. Stradivarius ♪ talk ♪ 07:04, 25 April 2014 (UTC)
FYI, when originally designing these things, we intentionally did not place those links there. The reason was: Better to not confuse 1000s of people with meaningless links and to let the few dozen who actually use them take the effort of scrolling to a consistent easily findable spot in the page. I still feel that way —TheDJ (talkcontribs) 07:21, 25 April 2014 (UTC)
Also, the documentation page itself can be shared amongst templates, in which the particular suggestion is hardly possible/logical (though with lua, a lot can become possible). Those links are always page specific. It's also the reason of having the separate box for the links. Part 1 is the documentation, Part 2 is the Template generics. —TheDJ (talkcontribs) 07:25, 25 April 2014 (UTC)
This is also why i hate stuff like: {{lua}}. That stuff is a technical detail that we should not bother users of the template with. It belongs at the very bottom. —TheDJ (talkcontribs) 07:27, 25 April 2014 (UTC)
These are good points. In light of this, perhaps sandbox and test cases links at the top would be better implemented as custom user JS/CSS, rather than being added to Module:Documentation. Also, I do kind of agree about {{lua}}, even though I was the one who made it into the monstrosity it is today. :) Let's discuss changing that at Template talk:Lua. — Mr. Stradivarius ♪ talk ♪ 08:00, 25 April 2014 (UTC)
I would be in support of a sysop default enabled gadget that does this. —TheDJ (talkcontribs) 12:04, 25 April 2014 (UTC)
Template-editor default enabled, too.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  10:00, 5 May 2014 (UTC)
  • Sorry not to've returned here sooner. I'm not keen on Jackmcbarn's version – but appreciate the suggestion – and, unfortunately, as I don't know Lua, someone else will need to code whatever might be added. Adding the links is merely for convenience, but each time I find myself needing to scroll/page down, I'm reminded that it seems to be a convenience missed among all the others supplied. For simplicity's sake, I'd try to get the Documentation template, from wherever it'd been transcluded, to test whether or not the subpages /sandbox and /testcases existed and add or omit the links accordingly. I don't imagine a couple more links after [purge] on the title line would then risk confusing people, even if/when noticed, as they'd only appear if/when the adjacent /sandbox and /testcases pages existed.
Any chance something like the above might happen? Sardanaphalus (talk) 09:32, 5 May 2014 (UTC)

remove Module:HtmlBuilder

hi what about removing the dependacy on this Module:HtmlBuilder module because it is not longer avilible nor updated. what about using this which is basically what the module is http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#HTML_library 94.197.122.87 (talk) 13:37, 7 May 2014 (UTC)

See Wikipedia talk:Lua#mw.html library nil behaviour. — Mr. Stradivarius ♪ talk ♪ 13:43, 7 May 2014 (UTC)

Error in module:documentation/sandbox

Hi there's an error in module:documentation/sandbox because when visiting template:documentation/sandbox it shows this error

Lua error in mw.html.lua at line 345: Tag name must be a string. Backtrace: [C]: in function "error" mw.html.lua:345: in function "create" Module:Documentation/sandbox:129: ? (tail call): ? mw.lua:571: ? — Preceding unsigned comment added by 94.9.136.59 (talk) 15:09, 8 May 2014 (UTC)

It's a sandbox. Who cares? Besides, Darklama is actively editing it right now. Jackmcbarn (talk) 15:14, 8 May 2014 (UTC)
ok sorry 94.9.136.59 (talk) 15:37, 8 May 2014 (UTC)

Please revert from the old logo to the new one please change this

-- 'documentation-icon-wikitext' --> 'Documentation icon'

To

-- 'documentation-icon-wikitext' --> 'Documentation icon'

Because the latest edit revert to the old logo use in template documentation 2.218.227.206 (talk) 16:19, 3 June 2014 (UTC)

Why? The new one is better. Jackmcbarn (talk) 16:20, 3 June 2014 (UTC)
we had the logo a while back and then we switchtched to the png one because that one looks much better. 2.218.227.206 (talk) 16:26, 3 June 2014 (UTC)
Can you point me to a diff? Also, the PNG one looks terrible on high-DPI screens, since it doesn't scale up. Jackmcbarn (talk) 16:33, 3 June 2014 (UTC)
What if we used File:Test Template Info-Icon.svg or File:Test Template Info-Icon - Version (2).svg? Jackmcbarn (talk) 16:37, 3 June 2014 (UTC)
ok could we use this [[File:Test Template Info-Icon - Version (2).svg]] please. 86.135.251.100 (talk) 18:25, 3 June 2014 (UTC)
 Done Jackmcbarn (talk) 22:38, 3 June 2014 (UTC)
Thanks. 86.135.251.100 (talk) 06:43, 4 June 2014 (UTC)

Big gap at bottom

Hi there is now a big gap at the bottom of documentation. 2.124.129.220 (talk) 10:37, 6 June 2014 (UTC)

I don't see a big gap. What page is it on? Jackmcbarn (talk) 13:58, 6 June 2014 (UTC)
My guess: extra whitespace is being introduced by the category code at the bottom of whichever /doc page is being displayed. — Mr. Stradivarius ♪ talk ♪ 15:36, 6 June 2014 (UTC)
it is at the bottom. It is between the end box and categories. 2.124.129.220 (talk) 23:22, 6 June 2014 (UTC)
I see a relatively large gap before the categories in Template:Periodic table, but not in Template:History of Japan. note that switching to the old version of the template removes the gap. checking the HTML source, it looks like tidy (or something) is adding an extra <p><br></p> at the end, which is usually a sign of spurious newlines. Frietjes (talk) 23:41, 6 June 2014 (UTC)
Ah, yes, you're right. A little playing with Special:ExpandTemplates shows that Module:Documentation is adding an extra newline right at the end of the output. It doesn't appear to be a problem with Module:Message box, but in Module:Documentation itself. — Mr. Stradivarius ♪ talk ♪ 00:43, 7 June 2014 (UTC)
And now fixed. It was an extra .newline() before the tracking category function. — Mr. Stradivarius ♪ talk ♪ 00:49, 7 June 2014 (UTC)
thanks 86.135.251.100 (talk) 16:11, 7 June 2014 (UTC)

Logo for module

Hi could we add a logo for module so it is not using the one for if it was on a template or something else please. 86.135.251.100 (talk) 16:18, 7 June 2014 (UTC)

Why? You still use curly braces when calling modules from wikitext, and the logo signifies "documentation" more than "template" anyway. Jackmcbarn (talk) 16:30, 7 June 2014 (UTC)
ok 86.135.251.100 (talk) 19:24, 7 June 2014 (UTC)

Mobile view

Hi when visiting a page with template documentation for example Template:infobox it does not show it correctly meaning the background is not shown and the edit button is to close to the name of the template. On the iPad it does not look so good. 86.135.249.133 (talk) 19:48, 18 June 2014 (UTC)

Found a way of adding background colour

Hi I had found a way of adding background colour by using this code

	local root = htmlBuilder.create()
	root
		.wikitext(p.protectionTemplate(env))
		.wikitext(p.sandboxNotice(args, env))
		 -- This div tag is from {{documentation/start box}}, but moving it here
		 -- so that we don't have to worry about unclosed tags.
		.tag('div')
			.attr('id', message('main-div-id'))
			.addClass(message('main-div-classes'))
                        .css('background-color', '#ecfcf4')
                        .css('border', '1px solid #aaa')
                        .css('padding', '12px')
			.newline()
			.wikitext(p._startBox(args, env))
			.wikitext(p._content(args, env))
			.tag('div')
				.css('clear', 'both') -- So right or left floating items don't stick out of the doc box.
				.newline()
				.done()
			.done()
		.wikitext(p._endBox(args, env))
		.wikitext(p.addTrackingCategories(env))
	return tostring(root)
end

So wikis that doint have the colour set in mediawiki.common.css. Can set background colour now. 86.135.249.133 (talk) 18:46, 21 June 2014 (UTC)

We build our templates for Wikipedia. We're not going to add extra complexity to them so they work on non-WMF wikis. Jackmcbarn (talk) 18:50, 21 June 2014 (UTC)

Debate by edit summary

Would Technical 13 please explain the purpose of the proposed edits, and allow time for others to respond. WP:TPE was not intended for playing ping-pong. Johnuniq (talk) 04:09, 3 July 2014 (UTC)

Module:Documentation/config still uses "docusage"

This parameter was removed from Template:Pp-template in 2010, but is still present in Module:Documentation/config. Shouldn't it be removed from the module as well? Helder.wiki 17:17, 7 July 2014 (UTC)

Module:Documentation: allow parameter aliases

Hi!

I finally had the time to try to replicate the migration of the template to Lua on Portuguese Wikipedia, since the module is intented to be portable, but the parameter "conteúdo" ("content") did not work. Could this be implemented in the configs? Helder.wiki 22:12, 3 July 2014 (UTC)

As in: the template should understand non-English parameter names? No. I think non-English template/parameter names should not be allowed. See lengthy discussion here. -- [[User:Edokter]] {{talk}} 09:48, 4 July 2014 (UTC)
You need to port the template over to pt.wikipedia. Once it's been copied there, you can rename all the parameters whatever you want. But en.wiki does not support non-English parameters, and will not add them. VanIsaacWScont 10:33, 4 July 2014 (UTC)
Sorry, I was talking about the module but now I see that Module talk:Documentation redirects here...
Anyway, what I need is something like Mr. Stradivarius did for Module talk:Namespace detect#Allow parameter aliases, to reduce the maintenance of a fork of the Module:Documentation. Helder.wiki 12:38, 4 July 2014 (UTC)
@Helder.wiki: Would a simple one-to-one switch be enough? As in, you set the "content-parameter" message to "conteúdo", and then the |conteúdo= parameter works but the |content= parameter doesn't? Or do you really need a solution like Module:Namespace detect's, where the default English parameter names are always available, and a table of aliases for each parameter can be specified in the config? — Mr. Stradivarius ♪ talk ♪ 13:55, 4 July 2014 (UTC)
@Mr. Stradivarius:: from what I see in the current ParserFunctions-based code, both "content" and "conteúdo" are available, so it would be better to keep both working. Helder.wiki 14:24, 4 July 2014 (UTC)
@Mr. Stradivarius: Do you think the module would work as expected if I make this change in pt:Template:Documentação?
- {{#invoke:documentação|main|_content={{ {{#invoke:documentação|contentTitle}}}}}}
+ {{#invoke:documentação|main|_content={{ {{#invoke:documentação|contentTitle}}}}|content={{{conteúdo|{{{content|}}}}}}}}
Helder.wiki 18:21, 4 July 2014 (UTC)
@Helder.wiki: Yes, I think it would work, but you don't need to do that now. I've added code to allow multiple parameters in Module:Documentation/sandbox and Module:Documentation/config/sandbox. Would anyone object to me updating the main module with this code? — Mr. Stradivarius ♪ talk ♪ 01:35, 5 July 2014 (UTC)
Nice! I didn't test, but the code looks good to me. Helder.wiki 02:42, 5 July 2014 (UTC)
I implemented the new version in Portuguese Wikipedia. It seems to be working fine. Helder.wiki 14:51, 8 July 2014 (UTC)

Do we support a "/Print" page version this way?

I stumbled upon a /Print subpage. It appears to show extra text in the Link box. This is where: {{Infobox element}} (with its /doc) has Template:Infobox element/Print, named in the /doc link box way below. I assume it has an "#ifexist" switch.

I wonder if that is still the right way to go. Shouldn't all "print" options (aka "print version"?) be controlled through HTML classes &tc.?

Unless I learn more from this, I'll put that single example page up for speedy. And I note that, in template ns, one cannot even get a (wiki) "printable version" a page (as in mainspace, userspace, most talkspaces). -DePiep (talk) 16:51, 17 July 2014 (UTC)

A /Print subpage, whilst not common, is recognised as a normal feature. If you look at the bottom of Template:Infobox element, the bottom documentation box (beginning "The above documentation is transcluded from Template:Infobox element/doc") has four lines instead of the usual three. The extra line reads "A print version of this template exists at /Print. If you make a change to this template, please update the print version as well." --Redrose64 (talk) 19:05, 17 July 2014 (UTC)
Are those /Print templates even working? See bugzilla:48052. Helder.wiki 19:12, 17 July 2014 (UTC)
re Redrose64: yes, that was what I am pointing at ("Link box" is used to refer to the bottom box of a doc page, where /sandbox links are).
So my question is: what is is good for, nowadays? A "normal feature"?, I have not met it ever. It also looks like one has to change the transcluding page code (article?) to consume its effect. No more background? -DePiep (talk) 21:22, 17 July 2014 (UTC)