Template:InfoBox ohloh/sandbox

From Gentoo Wiki
Jump to:navigation Jump to:search


Correct

One anonymous parameter (an Ohloh project name)
Wiki code
{{InfoBox stack
| {{InfoBox ohloh|gentoo}}
}}
Main version
Sandbox version


No parameter (when title contains no spaces)
Wiki code
{{InfoBox stack
| {{InfoBox ohloh}}
}}
Main version
Sandbox version


↑ If the Ohloh project identifier matches the page title (all lowercase), then it is convenient to drop the anonymous parameter and call the template with no parameters. However, this doesn't work when the page title contains spaces (like this page, titled InfoBox ohloh). This example is being rendered as if the page title is the single word InfoBox. The first "Incorrect" example below shows what really happens when the page title contains a space. (Note that Open Hub project names for multiword software titles sometimes replace spaces with hyphens but sometimes use a special abbreviated version of the name [like mozlaunch for "Mozilla Launchers"], so it is not possible to automatically covert titles with spaces to valid project ids. Just search for the project title at Ohloh and use the anonymous parameter to specify the Ohloh project name, as shown in the previous example.)


Using header=true
Wiki code
{{InfoBox stack
| {{InfoBox ohloh|gentoo|header=true}}
}}
Main version
Resources
Sandbox version
Resources


Incorrect

Using no parameter when the page title contains a space (link text contains part of page title)
Wiki code
{{InfoBox stack
| {{InfoBox ohloh}}
}}
Main version
Sandbox version


↑ The title of this page, InfoBox ohloh, contains a space, which is causing the second word of the page title (ohloh) to show up as the first word of the link text. This is because the wikicode that forms the external link is [https://www.openhub.net/p/infobox ohloh Ohloh] instead of, say, [https://www.openhub.net/p/infobox_ohloh Ohloh].


Used outside of an {{InfoBox stack}} (wide box, not right-floated)
Wiki code
{{InfoBox ohloh|gentoo}}
Main version
Sandbox version
Note
This is the template sandbox page for Template:InfoBox ohloh (diff).
See also the companion subpage for test cases.