Wikipedia:Signpost/Templates/Signpost-article-comments-end/commentspage/doc

Usage
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 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
There is kind of a complicated test going on here, which is kind of complicated, so I will try to excerpt and explain: 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
This uses two classes, both styled at Wikipedia Signpost/Templates/external.css and Wikipedia Signpost/Templates/master.css (split out on 22:35, 6 July 2024 (UTC)).

Sample transclusion of this template (includes full Signpost comments page)

 * Note: original page is Wikipedia talk:Wikipedia Signpost/2022-01-30/Arbitration report.


 * — 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)