PrimeHunter (talk | contribs) change {{SUBJECTPAGENAMEE}} to {{SUBJECTPAGENAME}} in template call expecting a normal page name and not url encoding |
PrimeHunter (talk | contribs) restore urlencode of custom page name from version by Seppi333, link target page if custom page name is given |
||
Line 2: | Line 2: | ||
<tr> |
<tr> |
||
<td class="mbox-image">[[File:Open data small color (vector).svg|32px|link=]]</td> |
<td class="mbox-image">[[File:Open data small color (vector).svg|32px|link=]]</td> |
||
<td class="mbox-text" style="text-align: center; font-weight: bold;">Daily {{plainlink|url=https://tools.wmflabs.org/pageviews/?project=en.wikipedia.org&platform=all-access&agent=user&range=latest-{{{1|{{{days|365}}}}}}&pages={{{2|{{{target|{{ |
<td class="mbox-text" style="text-align: center; font-weight: bold;">Daily {{plainlink|url=https://tools.wmflabs.org/pageviews/?project=en.wikipedia.org&platform=all-access&agent=user&range=latest-{{{1|{{{days|365}}}}}}&pages={{urlencode:{{{2|{{{target|{{SUBJECTPAGENAME}}}}}}}}}}|name=pageviews}} of {{#if:{{{2|{{{target|}}}}}}|[[{{{2|{{{target|}}}}}}]]|{{talkspace detect |
||
| main = this article |
| main = this article |
||
| default = {{SUBJECTPAGENAME}} |
| default = {{SUBJECTPAGENAME}} |
||
| other = this page |
| other = this page |
||
}}}} |
|||
</td> |
</td> |
||
</tr><tr> |
</tr><tr> |
Revision as of 15:08, 8 March 2020
Daily pageviews of this page | |
This template reports the daily page views for an article over a period of time (default: the last year), placing them in a suitable frame with a heading. It is typically placed on an article's talk page below other talk page banners.
Usage
Basic syntax (annual data):
Template syntax with optional parameters:
{{Annual readership|expanded=|days=|target=|title=|color=|scale=|width=|height=}}
Optional parameters
|expanded=
can be used to override the default auto-collapsing of the message box. To prevent the graph from being collapsed on page load, use|expanded=true
.|days=
(default: 365) can be used to change the number of pageview days depicted in the graph.|target=
(default: {{SUBJECTPAGENAME}}) can be used to simultaneously specify the page in the graph title (if|title=
is not specified) and the page for which page traffic is displayed.|title=
(default: see notes) can be used to specify the page in the graph title.|color=
(default: #00f) can be used to change the graph color; accepted inputs include HTML color names (e.g., red) and hex codes.|scale=
(default: linear) can be used to change the scale of the y axis; accepted inputs: linear, log, pow, sqrt, quantile, quantize, and threshold.|width=
(default: 570) may be used to change the width in pixels of the image.- Note: Default of 570px is used to match standard Talk page boxed items; values outside the range of 400–980 may be problematic.
|height=
(default: 200) may be used to change the height.
Notes about the graph title
If both |title=
and |target=
are not specified, the graph title varies depending on the namespace of the page where this template is used.
- Title if placed on an article talk page:
- Daily pageviews of this article
- Title if placed on a page in any other talk namespace (e.g., "User talk:", "Template talk:", "Wikipedia talk:", etc.):
- Daily pageviews of {{SUBJECTPAGENAME}}
- Title if placed on any subject page (i.e., pages in namespaces like "User:", "Template:", "Wikipedia:", etc.):
- Daily pageviews of this page
If |title=
is not specified, but |target=
is specified, the graph title is set as "Daily pageviews of target page", with the target page linked.
If |title=
is specified, regardless of the specification of |target=
, the graph title is set as "Daily pageviews of text", with the text unlinked.
- For example, inputting
|title=XYZ
would set the graph title as:- Daily pageviews of XYZ
- For example, inputting
|title=[[XYZ]]
would set the graph title as:
Examples
| ||||||||
| ||||||||
For comparison, here's the same template as above except with a linear scale:
| ||||||||
|
See also
- {{Page views double}} – use if two graphs are needed; designed for topics with spiky pageviews
- {{Graph:PageViews}} – Use instead, if further variations are desired