Help talk:Wikitext

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Wikipedia Help Project (Rated C-class, High-importance)
WikiProject iconThis page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
C-Class article C  This page does not require a rating on the project's quality scale.
 High  This page has been rated as High-importance on the project's importance scale.
 

Creating an external link that is variable based on a parameter[edit]

Can anyone tell me if there is a way to create a template that generates an external link and places a parameter to the template's transclusion into the URL? It appears to me to be impossible. For instance, a template called Test with content "[http:/foo.com/{{{1}}}.html test]" generates "[http://foo.com/%7B%7B%7B1%7D%7D%7D.html test]" when invoked as {{Test|index}}. I suppose it has to do with parsing order of "[" and template processing. But I'm hoping there is a workaround. DulcetTone (talk) 12:01, 1 April 2018 (UTC)

@DulcetTone: I'm not seeing that at User:John of Reading/X2 and User:John of Reading/X3. The parameter "index" is correctly built into the URL. -- John of Reading (talk) 12:34, 1 April 2018 (UTC)
@DulcetTone: Your code is correct except http:/ needs an extra slash http:// which appears in the alleged result so your example is false. I didn't see any attempt to make this code in your recent edits. I will go out on a limb and guess you also falsified "index" in the example and your real example had a string with an equals sign. In that case you can invoke it with {{Test|1=index}} to avoid the equals sign being interpreted as a parameter assignment. See the first bullet at Help:Template#Usage hints and workarounds. Please always make, copy-paste or link real examples when you report problems. PrimeHunter (talk) 14:12, 1 April 2018 (UTC)
You are correct that I was typing the above longhand, which explains the poor syntax you see (sorry). After some further testing, I see the issue is one I did not capture in my hand-typed example. The template X2 given above, as well as mine, breaks ONLY when you have the template also wrapping its output in <ref> and </ref> Try editing X2 to be: <ref>[http://example/com/{{{1}}}.html test]</ref> and it will fail (at least on my MediaWiki 1.24.2 DulcetTone (talk) 13:24, 2 April 2018 (UTC)
@DulcetTone: Thanks for posting a mostly correct example. It should say example.com and not example/com to produce a valid link. The {{#tag:ref}} trick at Help:Template#Handling parameters works in Wikipedia: {{#tag:ref|[http://example.com/{{{1}}}.html test]}}. PrimeHunter (talk) 14:23, 2 April 2018 (UTC)
Thanks so much for this, PrimeHunter. Solves the thing that was killing me. DulcetTone (talk) 22:34, 3 April 2018 (UTC)

Note changes to whitespace behavior (documented at mw:Specs/wikitext/1.0.0)[edit]

Please update the help files or add a link to that change as appropriate. SSastry (WMF) (talk) 16:04, 9 May 2018 (UTC)

www.rajeduboard.in Official Wiki, Check Alexa Ranking and Daily Visitors[edit]

Rajeduboard.in (talk) 10:39, 10 July 2018 (UTC)

http://www.rajeduboard.in/ is an educational web portal for all the Indians. www.

rajeduboard.in provides all the government notification and their related announcements.

 Not done: The link is not needed, also blatant conflict of interest. --Danski454 (talk) 11:12, 10 July 2018 (UTC)

Blockquote or preformatted block[edit]

A sequence of lines, each beginning with the blank character, produces a blockquote or preformatted block. No mention in the sections on block quoting or preformat, that I see. Is that intentional?

Also, a tab at the beginning of a line is omitted. A tab following a blank at the beginning of a line is respected. Is that intentional? Why not respect the tab in both cases?

Thanks, ... PeterEasthope (talk) 14:53, 10 August 2018 (UTC)

Tabs have no special meaning in MediaWiki syntax; unlike spaces and newlines, they are passed through unchanged. The behaviour of tabs is browser dependent - in most cases, they are treated exactly as for unprocessed spaces and newlines. --Redrose64 🌹 (talk) 16:02, 10 August 2018 (UTC)