Wikipedia:Signpost/Templates/Signpost-article-comments-end/commentspage/doc
This is a documentation subpage for Wikipedia:Signpost/Templates/Signpost-article-comments-end/commentspage. It may contain usage information, categories and other content that is not part of the original wikipedia page. |
Usage
[edit]This appears transcluded at the top of talk pages for Signpost articles. These talk pages are themselves transcluded in a couple of places:
- The Signpost articles themselves
- Underneath the article, e.g. Wikipedia:Wikipedia Signpost/2022-01-30/Arbitration report.
- Single-talk pages
- All of the talk pages for an issue in a row, e.g. Wikipedia talk:Wikipedia Signpost/Single/2022-01-30
The idea is that this template gives a little link back to the main article, and explains that it's a comment page, but ONLY on the talk page itself -- in both of the places where this talk page gets transcluded, this is basically unhelpful noise, so it isn't included there.
Code
[edit]There is kind of a complicated test going on here, which is kind of complicated, so I will try to excerpt and explain:
{{#ifeq:{{is time|{{#titleparts:{{PAGENAME}}|1|2}}}} {{NAMESPACE}}<!--
-->|1 Wikipedia talk
This is a bit of fun with parser functions.
- The titleparts bit is taking the second part of the title (for a comment page, this will be "Wikipedia talk:Wikipedia Signpost/2024-07-04/Recent research").
- The {{is time}} template tests whether that segment can be parsed as a time. For that page, the answer is yes (i.e. "1") -- for a different page, like Wikipedia talk:Wikipedia Signpost/Single/2024-07-04, it would be no (i.e. "").
- The NAMESPACE magic word will return the namespace. In this instance, it's "Wikipedia talk". On the article associated with the column, which is Wikipedia:Wikipedia Signpost/2024-07-04/Recent research, it isn't.
- The ifeq tests whether these things, concatenated with " and ", form the string "1 and Wikipedia talk", which should only be true if it's a comment page, and otherwise it isn't, which means that otherwise it will not include that header.
Classes and styles
[edit]This template uses TemplateStyles: |
This uses two classes, both styled at Wikipedia:Wikipedia Signpost/Templates/external.css and Wikipedia:Wikipedia Signpost/Templates/master.css (split out on 22:35, 6 July 2024 (UTC)).
signpost-commentspage1
signpost-commentspage2
Sample transclusion of this template (includes full Signpost comments page)
[edit]- Note: original page is Wikipedia talk:Wikipedia Signpost/2022-01-30/Arbitration report.
The current scope is "all pages related to India, Pakistan, and Afghanistan"; the amendment would expand it to cover "all pages related to political or religious topics and closely related people in India, Pakistan, and Afghanistan, including but not limited to castes".
— Isn't that a contraction rather than an expansion? —2d37 (talk) 21:45, 31 January 2022 (UTC)
- You're right, I believe. I will double-check to make sure. jp×g 22:09, 31 January 2022 (UTC)