Help talk:Pipe trick

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
WikiProject iconWikipedia Help NA‑class Mid‑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.
NAThis page does not require a rating on the project's quality scale.
MidThis page has been rated as Mid-importance on the project's importance scale.

Example formatting, and suggested merge[edit]

needs better formatting on the examples, and PROBABLY a merge with Help:Magic. Uncle Ed July 7, 2005 18:26 (UTC)

I have to agree with you on this. --Siva1979Talk to me 23:28, 31 May 2006 (UTC)[reply]

Why doesn't it work in gallery captions?[edit]

This is annoying. pfctdayelise (translate?) 09:08, 25 April 2006 (UTC)[reply]

also bugzilla:2700. pfctdayelise (translate?) 09:13, 25 April 2006 (UTC)[reply]

<gallery>
File:Bad Title Example.png|[[Wikipedia:Community Portal|]]
</gallery>

Reverse Pipe trick[edit]

How does this work? If I put [[|Agonizer]] into my sandbox, I simply get [[Agonizer]]. Thanks. —anskas 13:08, 27 October 2006 (UTC)[reply]

It depends on the name of the page you're editing. Try using it on a page with a comma or parentheses in the title. —Ilmari Karonen (talk) 12:59, 28 October 2006 (UTC)[reply]
Aha! Brilliant. I will reword the section to make this feature easier to understand. —anskas 16:46, 28 October 2006 (UTC)[reply]

Sorry: I still don't get it. Why would you need this trick? It seems to me that you'd be referring back to the very page the reader is reading. Is the idea to simplify links to sections of the page? Please enlighten me! --NigelG (or Ndsg) | Talk 12:11, 1 February 2007 (UTC)[reply]

It saves you from having to type disambiguation page names directly as link targets in the wikitext. For example if I am editing Foo (disambiguation) and I need to type "see also the disambiguation page for Foo foo", I could do it two ways: the "normal" pipe trick (type [[Foo foo (disambiguation)|]]), or the reverse pipe trick (type only [[|Foo foo]]). The reverse pipe trick saves you many more letters to type; and I see it will be especially useful for people who cannot spell "disambiguation". In short, since you are editing a disambiguation page, the software knows you want another disambiguation page, so it supplies the (disambiguation) part automatically. Resurgent insurgent 06:08, 14 May 2007 (UTC)[reply]
Resurgent insurgent, this was a very helpful explanation. I think it should be added to the section. Currently the section gives an example without even explaining the basic concept, which I think is bad form and confusing.--Evil1987 15:45, 4 July 2007 (UTC)[reply]

No Trick![edit]

I greatly admire this "trick" but note that it is not widely used. Perhaps it should not describe itself as a "trick", as this implies (to me, so perhaps to others) that it may be unreliable or unapproved. To cite a concrete example... All UK Parliament constituencies have their own article (I'm not sure that this is a good idea, but it is (probably) a fact). These articles have a standard naming convention: so, for example, the article for High Peak UK Parliament constituency is called High Peak (UK Parliament constituency). The Infobox England place template has a Constituency parameter that currently expects a full link like "[[High Peak (UK Parliament constituency)|High Peak]]" (it happily accepts this Pipe trick, but the examples show the full form). I'd like to suggest replacing this with the simple name (e.g. "Constituency=High Peak"), having the template translate this into "[[High Peak (UK Parliament constituency)|]]". As this template is already used on over a thousand articles (and growing) it's important that it doesn't rely on a "trick" that may be subject to change.--ARAJ 11:24, 2 February 2007 (UTC)[reply]

You can type this in everywhere that full links are accepted. If the example doesn't show it that's because the designer(s) of the template didn't care to show it. The only place this will not work is in <ref> tags and you will never use infoboxes inside those, so using this trick in infoboxes is safe. Resurgent insurgent 06:12, 14 May 2007 (UTC)[reply]
The main "pipe trick" (typing [[X (Y, Z)|]] to get [[X (Y, Z)|X]] is expanded at the time the article is saved. So you don't have to worry about whether it will work in the long term - it's as if you typed the full link by hand. RossPatterson (talk) 23:31, 19 January 2008 (UTC)[reply]

within <ref> tags[edit]

Does the trick delibately not work within in <ref>tags, or should this be reported as a bug? Tim! (talk) 10:09, 17 November 2007 (UTC)[reply]

Its a known issue (PST (which is basically pipe trick, sigs and subst:) is not done in parser tags). See bugzilla:2700 Bawolff (talk) 17:44, 18 July 2012 (UTC)[reply]

You live and learn![edit]

I've used the pipe trick for some time, but only just discovered that the expansion occurs immediately you hit save page - I'd always assumed the page saved with the pipe trick, and only expanded the link when the software converted the wiki markup into a standard html link. Has this always been the case? —  Tivedshambo  (t/c) 07:44, 12 March 2008 (UTC)[reply]

Yes.--Patrick (talk) 00:14, 13 March 2008 (UTC)[reply]

Does this still work?[edit]

So why doesn't [[|nipples]] work?

(it gives: nipples ; i'm expecting Help_Talk:Nipples) --Arkelweis (talk) 21:47, 19 September 2009 (UTC)[reply]

The section about this says that it only works "if the title of the article containing the link includes a parenthesized term or a comma". So it doesn't work for colon. Svick (talk) 23:59, 19 September 2009 (UTC)[reply]
Oh yeah, thanks :D --Arkelweis (talk) 03:48, 20 September 2009 (UTC)[reply]

Capitalisation/capitalisation[edit]

It would be helpful, if something about case be added to the documentation... I had to use trial and error to work out how to get a lower case link. SauliH (talk) 17:08, 28 July 2010 (UTC)[reply]

How did you do that? feel free to add a section yourself if its missing Lee∴V (talkcontribs) 13:35, 29 July 2010 (UTC)[reply]

 DoneSauliH (talk) 15:26, 29 July 2010 (UTC)[reply]

Sections and subpages[edit]

The examples for sections and subpages now read as if the editor actually used the pipe trick on them when saving the page, but I am unable to get them to work on Wikipedia, and bugzilla:845 (“[[#foo|]], [[/bar|]] should be equivalent to [[#foo|foo]], [[/bar|bar]]”) is reopened since February 2010. Am I on drugs or was the generated text faked? If I’m not on drugs I suggest we avoid suggesting the pipe trick works with section and subpage links. Vadmium (talk, contribs) 03:28, 18 November 2012 (UTC)[reply]

Improved "pipe trick" behaviour[edit]

For a number of suggestions how to further improve the "pipe trick" behaviour see:

m:2016_Community_Wishlist_Survey/Categories/Editing#Improved_.22pipe_trick.22_behaviour

--Matthiaspaul (talk) 23:00, 15 November 2016 (UTC)[reply]

"Reverse pipe trick" section is difficult to understand.[edit]

I agree that the "reverse pipe trick" section is difficult to understand and may need more examples and/or explanation. --Mr. Guye (talk) 23:56, 22 March 2017 (UTC)[reply]

Long piped texts cause rendering issues on several standard browsers; devices !?[edit]

Another editor complained about the rendering of navbox "Template:US Mil. Support Rides; WW II–1990". Although I had some trouble replicating any rendering issues, I was able to get some funky rendering of the box on my late 2019 "smart" TV-set...
Turned out, my TV-set wasn't able to line-break very long piped texts... – which then influenced the rendering of the entire navbox in an adverse way. I've asked the other editor whether my alteration, version 15:51 of 14 October 2021, versus the previous version, (oldid=1049889600) 13:10 of 14 October 2021, has also fixed the rendering issue that he complained about. I don't know much more, than that he uses a tablet, possibly in portrait orientation. I've asked him for a bit more detail on device / OS, and browser used. --GeeTeeBee (talk) 16:22, 14 October 2021 (UTC)[reply]

CORRECTION — Long piped texts turn out to be a general issue ! — Taking my browser windows out of maxed, and making them narrow, showed that All my regular browsers (Chrome, FFox, Edge) are unable to line-break long piped-texts, resulting in some very peculiar template rendering... --GeeTeeBee (talk) 16:34, 14 October 2021 (UTC)[reply]
CORRECTION #2 — I now realize I should have posted this at Piped link — My sincere apologies --GeeTeeBee (talk) 16:47, 14 October 2021 (UTC)[reply]
@GeeTeeBee: I answered this at Wikipedia talk:Piped link#Long piped texts cause template rendering issues on several standard browsers; devices !?, please see WP:MULTI. In short: this is not a problem with piped links, you can add the |bodyclass=wraplinks parameter to the {{military navigation}} that is inside Template:US Mil. Support Rides; WW II–1990. --Redrose64 🌹 (talk) 08:46, 15 October 2021 (UTC)[reply]

Automatic expansion[edit]

Hi all, while editing a recently-saved draft, I just noticed that the pipe trick now seems to be physically expanding the piped text and saving it in the wiki markup. This, I see, is described in the help page's lede. I have never seen this behaviour before: I always thought that the whole point of the trick was to save typing, by ignoring words in parentheses etc.: and now it appears to be deliberately adding vast amounts of unnecessary verbiage, which I am opposed to. This may be related to an earlier post from 2008, #You live and learn! - but this makes it seem that the expansion has previously been turned off at some time. The trick is only for us editors' benefit, and I imagine many will know about it. So, if I'm not deceived, I'm wondering what is this change for, and for whom? And when did it happen? Cheers, >MinorProphet (talk) 00:22, 20 October 2021 (UTC)[reply]

@MinorProphet: PLease give an example of where this occurred, and indicate what you think that it should have become. --Redrose64 🌹 (talk) 07:16, 20 October 2021 (UTC)[reply]

Hi, @Redrose64:, hope you are well, thanks for replying. My example is this draft. Specifically, when I pressed 'Publish' and immediately edited the draft,

* [[2nd Panzer Division (Wehrmacht)|]] 

and all other examples of the pipe trick had been expanded in the saved markup to e.g.

* [[2nd Panzer Division (Wehrmacht)|2nd Panzer Division]]

I have tested it again just now with

* [[1st Panzer Division (Wehrmacht)|]], 

and the piped text is definitely expanded from the previous edit.

Up until now in my entire experience - I may be utterly mistaken - the saved markup has always and only been an unexpanded

* [[3rd Panzer Division (Wehrmacht)|]]

and that's how it would like to be, if possible. Again, how long has this been the default behaviour, and what's the purpose? OTOH, I may have been asleep under a stone. Cheers, MinorProphet (talk) 12:08, 20 October 2021 (UTC)[reply]

That's the whole point about the pipe trick - if you leave the part after the pipe is left empty, it's filled in at save time. Per Help:Pipe trick, para. 2: The described processing happens at the point of saving the page data, and the generated text is saved with the rest of the page's wiki markup – thus, it is merely an aid to editing. That's how it's behaved these last twelve years or more. I certainly don't recall any change in behaviour, certainly never encountered what you describe in your last paragraph. --Redrose64 🌹 (talk) 19:47, 20 October 2021 (UTC)[reply]
Thanks very much for your answer. Well, I must have been hallucinating for however many years past: when I saw the expanded text today it was a complete surprise. Having looked back at other old articles I see the same saved expanded markup, as explained in the lede. I am at a complete loss to explain this sudden realisation - perhaps I have just somehow been filtering out the whole expanded text... I must have used this technique thousands of times, and never once clocked the expansion until today. Yours confusedly, MinorProphet (talk) 22:12, 20 October 2021 (UTC)[reply]

Pipe Trick[edit]

That is cool I never knew it either. That is going to save me a ton of time now. Thanks for that tad of info! 2600:8801:CA05:EF00:D41E:2828:7AA7:A58D (talk) 16:52, 22 May 2023 (UTC)[reply]

Problem: Can't see from page preview whether the Pipe Trick will work[edit]

I expected my attempts to use the Pipe Trick in Special:Diff/1157928225#Locations would work, but it appears they haven't worked. No idea why! 213.18.145.207 (talk) 21:50, 31 May 2023 (UTC)[reply]

It's documented as not working at Help:Pipe trick#Section links. --Redrose64 🌹 (talk) 23:28, 31 May 2023 (UTC)[reply]