Template talk:Wikipedia Library access
![]() | This template does not require a rating on Wikipedia's content assessment scale. |
Feedback on the template
editIn order to bring the template to the attention of the wider community and invite feedback and discussion, I've posted notices at Wikipedia talk:The Wikipedia Library, Wikipedia talk:WikiProject Templates, Wikipedia talk:Citation templates and Wikipedia:Village pump (miscellaneous). Pineapple Storage (talk) 18:47, 24 July 2025 (UTC)
Discussion at Wikipedia talk:WikiProject Templates
editMarkup | Renders as |
---|---|
|
Full access available to users of The Wikipedia Library. |
Given that such a tiny proportion of readers could make use of the link...
that would be my only concern with using it in mainspace; the Library is (as far as I understand it) primarily a tool for editors, not readers. That being said, I think it would be a great tool for talk page discussions, in particular those looking for RS to support a given statement. Primefac (talk) 22:00, 24 July 2025 (UTC)- Thank you, yes that was my concern too. What are your thoughts on the option of using (for instance) Template:Main other and Template:If autoconfirmed to only display the template in mainspace for autoconfirmed users? Pineapple Storage (talk) 22:35, 24 July 2025 (UTC)
- If you didn't want it to be used in the article space, then wrapping it in {{main other}} would be a good option. Not sure if the second option is as good, since it would mean even talk page discussions would exclude IP editors. Primefac (talk) 22:46, 24 July 2025 (UTC)
- I was actually thinking of combining the two, so that the logic would be:
- If you didn't want it to be used in the article space, then wrapping it in {{main other}} would be a good option. Not sure if the second option is as good, since it would mean even talk page discussions would exclude IP editors. Primefac (talk) 22:46, 24 July 2025 (UTC)
- Thank you, yes that was my concern too. What are your thoughts on the option of using (for instance) Template:Main other and Template:If autoconfirmed to only display the template in mainspace for autoconfirmed users? Pineapple Storage (talk) 22:35, 24 July 2025 (UTC)
- Is the template in mainspace?
- No: template is displayed
- Yes: is the user is autoconfirmed, confirmed, XC or administrator?
- Yes: template is displayed
- No: template is hidden
- Is the template in mainspace?
- I'm not sure whether this kind of thing is normally done in templates, but I think in this case it might work quite well? Unless there's something I'm missing—which is quite possible, as I have very little template experience! Pineapple Storage (talk) 23:03, 24 July 2025 (UTC)
- I mean, I'm just one editor with one opinion. Your proposed solution would work if the template is designed to be used in the mainspace for editors to use. I think making that determination is the best first step. Primefac (talk) 23:13, 24 July 2025 (UTC)
- Of course, and I'm still hoping to get a wider discussion going to identify a consensus on the best application of the template; your comments have prompted me to clarify the logic behind the possible options as I see them, so I appreciate that! :) Pineapple Storage (talk) 23:34, 24 July 2025 (UTC)
- I mean, I'm just one editor with one opinion. Your proposed solution would work if the template is designed to be used in the mainspace for editors to use. I think making that determination is the best first step. Primefac (talk) 23:13, 24 July 2025 (UTC)
- I'm not sure whether this kind of thing is normally done in templates, but I think in this case it might work quite well? Unless there's something I'm missing—which is quite possible, as I have very little template experience! Pineapple Storage (talk) 23:03, 24 July 2025 (UTC)
- Haven't considered all the implications yet, but have you considered using it with param
|via=
of citation templates? What I usually do whenever I gain access to a source via TWL, is leave the normal, non-TWL link in param|url=
, and then add|via=[[WP:TWL|TWL]]
to the citation. Your template suggests an alternate approach: leave the original url in|url=
as before, but now use a different version of your template which would drop the 'available to users...' verbiage, and instead do this:
- Is the user autoconfirmed, confirmed, or XC? (don't think you need to include admin here)
- Yes: emit citation param
|via=[[<TWL url to resource>|TWL]]
, piping TWL to the resource - No: emit citation param
|via=[[WP:TWL|TWL]]
linking The Wikipedia Library
- Yes: emit citation param
- Is the user autoconfirmed, confirmed, or XC? (don't think you need to include admin here)
- That may be too radically different than what you had in mind, and I hope to come back with comments more directly related to how you conceive of it. (edit conflict) Mathglot (talk) 23:40, 24 July 2025 (UTC)
- Interesting! So in that scenario, would the template actually be used as the input for the
|via=
param in citation templates (eg.... |via={{twlac|...}}
) so that the main citation template will output— via [<TWL url> The Wikipedia Library].
(or— via The Wikipedia Library.
if the user isn't autoconfirmed)? Or would it be added outside the citation template but mimicking the|via=
param? As mentioned, I'm a complete template novice, so I'm not sure whether there would be COinS issues if it were used inside a citation template. Pineapple Storage (talk) 00:05, 25 July 2025 (UTC)- I was actually thinking of it being used inside, as the value of param
|via=
; if you are not familiar with that citation param, see Template:Cite journal#TemplateData, and scroll about 80% of the way down that long section, or search-on-page for 'via'. But in a way, it is sufficiently different from what you had in mind, that maybe it should be a new template. And your synopsis was correct; the TWL url would of course be enclosed in single brackets, and without the pipe. Mathglot (talk) 22:18, 25 July 2025 (UTC)- Don't worry, I am familiar with the 'via' parameter, I just wasn't sure whether there would be COinS issues that might prevent the use of the template inside a citation template! :) Pineapple Storage (talk) 03:23, 26 July 2025 (UTC)
- I was actually thinking of it being used inside, as the value of param
|via=
should not be used for this. The analog (pun intended): would you do this with checking a book out from The New York Public Library? Izno (talk) 22:48, 25 July 2025 (UTC)- See also this recent discussion, I suppose. Izno (talk) 22:51, 25 July 2025 (UTC)
- I don't see an analogy here. I would not do it with checking out a physical book from the NYPL, nor would I do it to link a digitized book at Google or Internet Archive that happened to be a scan from the NYPL collection, as that information is irrelevant to someone seeking to verify the article content by locating the resource. In neither case is it relevant to the reader/verifier to know that somebody found the book at NYPL, whether hardbound book, or an online version.
- However, the same cannot be said for resources discovered at some online repository like MUSE or Gale, or a search platform like TWL. In these cases, it is highly relevant to know where the item was found, to help a reader/researcher who wishes to find it. Users of TWL know that the search feature is finicky, and the same search that shows zero results at the top level of TWL search, (or too many results, like the 35,000 for 'OED') will find what you want if you go to the proper access link for the TWL partner, and search from there. Once you find the resource you are looking for, it is worth preserving the TWL url to save other editors the trouble, or even to show that the resource exists online at all.
- So, I think preserving the TWL url resulting from a successful TWL search is well worth it for verifiability, as well as for the productivity of future researchers. It turns out that trying to store it in the
|via=
param works, but is accompanied by a CS1 warning about urls found in non-url parameters, and trying to store it in a url-holding param like|entry-url=
is worse, because it gets stripped. So I guess we have all but reached a dead end at least with respect to current behavior of the citation templates and|via=
. A hidden comment could be used, but would be missed by most of the users who might have been helped by a TWL link in the citation. Mathglot (talk) 01:28, 26 July 2025 (UTC)- Hmm... I think what @Izno may have been getting at (please correct me if I'm wrong!) is that a lot of users, myself included, likely use TWL not necessarily as a search platform but as an institutional login, like you get from a university or another academic institution. The
|via=
parameter isn't used for institutional logins to an online publisher's website, for instance, and to my knowledge a lot of sources aren't actually hosted on TWL's database but rather have dedicated TWL URLs on their host site; in that case,|via=
probably isn't the best parameter, and having the template as a separate tag on the end of the citation would probably work better. Pineapple Storage (talk) 03:30, 26 July 2025 (UTC)- If what you say is right, then the idea of tagging something to the end of the citation just says to me that the citation is missing a param that should go inside it. But you would need consensus for that, so maybe creating the template as a tag-on is a halfway house that might get people exposed to it, and drum up support for further action. (Or not.) Mathglot (talk) 05:53, 26 July 2025 (UTC)
- Yes I guess that is a possibility; if so, I agree that any change to that effect would need to have further discussion, so this might help to provide an example. Pineapple Storage (talk) 06:26, 26 July 2025 (UTC)
- If what you say is right, then the idea of tagging something to the end of the citation just says to me that the citation is missing a param that should go inside it. But you would need consensus for that, so maybe creating the template as a tag-on is a halfway house that might get people exposed to it, and drum up support for further action. (Or not.) Mathglot (talk) 05:53, 26 July 2025 (UTC)
- Hmm... I think what @Izno may have been getting at (please correct me if I'm wrong!) is that a lot of users, myself included, likely use TWL not necessarily as a search platform but as an institutional login, like you get from a university or another academic institution. The
- See also this recent discussion, I suppose. Izno (talk) 22:51, 25 July 2025 (UTC)
- Interesting! So in that scenario, would the template actually be used as the input for the
- Just a quick note to say I've edited Template:Wikipedia Library access/sandbox to add
and
around the template. This feels a bit inelegant, and I don't know how to get the 'demo' parameter for Template:Main other to work properly (eg. for Template:Wikipedia Library access/testcases), so if anyone has time and knows of a way the sandbox version could be improved, that would be much appreciated! Pineapple Storage (talk) 06:30, 26 July 2025 (UTC)
- Are you familiar with templates {{If autoconfirmed}} and {{If extended confirmed}}? They wouldn't change anything for users, but might make it a bit easier for you (and other template editors) to follow and modify, perhaps. Otoh, your version would probably have fewer curlies, so maybe in the end your way is easier. Anyway, those templates might come in handy in some other situation which is less squirrely than this one. Mathglot (talk) 06:43, 26 July 2025 (UTC)
- Yes for sure, and that was what I was originally thinking of doing (see above), but I just checked and it looks like Template:If autoconfirmed already contains Template:Main other, so it felt like nesting the two would be a bit redundant? Again though, I might be missing something. Pineapple Storage (talk) 06:49, 26 July 2025 (UTC)
- Oops, carry on, you seem to have thought of everything. Pretty good, for someone just getting into templating. Mathglot (talk) 07:03, 26 July 2025 (UTC)
- Thanks! :D I think it's just because I'm still in the conscious incompetence phase, so I try to look for all the possible options before making any changes... Input and improvements from more experienced template editors are still very much welcome! Pineapple Storage (talk) 07:15, 26 July 2025 (UTC)
- Oops, carry on, you seem to have thought of everything. Pretty good, for someone just getting into templating. Mathglot (talk) 07:03, 26 July 2025 (UTC)
- Yes for sure, and that was what I was originally thinking of doing (see above), but I just checked and it looks like Template:If autoconfirmed already contains Template:Main other, so it felt like nesting the two would be a bit redundant? Again though, I might be missing something. Pineapple Storage (talk) 06:49, 26 July 2025 (UTC)
- Another quick note: I've been playing around with Template:Wikipedia Library access/sandbox again and I've reached a bit of an impasse. I ended up opting for the
{{#tag:span|content|attribute="name"}}
magic word to wrap the template in span tags, with aclass="autoconfirmed-show"
attribute which is conditional on a namespace check. (The sandbox version is currently set to not show for non-autoconfirmed users in Template namespace, ie.{{ns:10}}
, to try and allow a demo in Template:Wikipedia Library access/testcases; for the real template, this would obviously be replaced with{{ns:0}}
to hide it for non-autoconfirmed users in mainspace only.) I've been checking whether the template is showing up on testcases using my alternate (non-autoconfirmed) account User:Pineapple Storage 2 in another browser, and I can't get it to work properly, ie. display for autoconfirmed and hide for non-autoconfirmed; at the moment, it's displaying for both. I'm having real trouble working out how to fix it and I think some fresh eyes on the issue could help, so if anyone has time to look over it and see if you can identify the problem, that would be very much appreciated! :) Pineapple Storage (talk) 00:03, 27 July 2025 (UTC)- Before even attempting a response to a detailed question about a template with a lot of levels of nesting, I would look to see how easy it is to follow the conditionals, and in this case, it is very difficult, so I would not attempt it without pretty-printing the code first, but even that is non-trivial (we should have a tool for that) so I quickly gave up. See something like Template:Chart for a pretty-printed template. (I'm not sure how you are even debugging at all, without having a pretty-printed version; if you are doing that offline or between saves, it's perfectly all right to release a pretty-printed version that works properly.) Mathglot (talk) 02:59, 1 August 2025 (UTC)
- Yes, I've had real trouble with that too... I did try pretty-printing it but beyond a certain point, adding line breaks etc actually affected the output/functionality of the template, so I didn't want to proceed any further and risk messing the whole thing up even more. Thank you for linking Template:Chart; that template seems to use <!-- --> notation to enclose line breaks and indentation, which (now that I think about it) seems like an obvious solution! I will have a go at implementing that and get back to you. Thank you again! Pineapple Storage (talk) 13:48, 1 August 2025 (UTC)
- @Mathglot Sorry about that, I've gone through and prettified the code at Template:Wikipedia Library access/sandbox so hopefully it's now a bit more approachable! Feel free to tweak the formatting etc. if you notice any room for improvement/clarification. Pineapple Storage (talk) 15:44, 1 August 2025 (UTC)
- Yes, I've had real trouble with that too... I did try pretty-printing it but beyond a certain point, adding line breaks etc actually affected the output/functionality of the template, so I didn't want to proceed any further and risk messing the whole thing up even more. Thank you for linking Template:Chart; that template seems to use <!-- --> notation to enclose line breaks and indentation, which (now that I think about it) seems like an obvious solution! I will have a go at implementing that and get back to you. Thank you again! Pineapple Storage (talk) 13:48, 1 August 2025 (UTC)
- I think I've now actually fixed the issue of the <attribute class="autoconfirmed-show"/> not being applied to the template... I don't think the function recognised the attribute if it was enclosed in a conditional expression, so to fix this I just duplicated the whole template inside a conditional expression, with the only difference being the presence/absence of the tag attribute, based on the namespace detected. Again, this feels a bit inelegant, so I'm very open to suggestions on how this can be streamlined! Pineapple Storage (talk) 18:12, 1 August 2025 (UTC)
- Before even attempting a response to a detailed question about a template with a lot of levels of nesting, I would look to see how easy it is to follow the conditionals, and in this case, it is very difficult, so I would not attempt it without pretty-printing the code first, but even that is non-trivial (we should have a tool for that) so I quickly gave up. See something like Template:Chart for a pretty-printed template. (I'm not sure how you are even debugging at all, without having a pretty-printed version; if you are doing that offline or between saves, it's perfectly all right to release a pretty-printed version that works properly.) Mathglot (talk) 02:59, 1 August 2025 (UTC)
- Are you familiar with templates {{If autoconfirmed}} and {{If extended confirmed}}? They wouldn't change anything for users, but might make it a bit easier for you (and other template editors) to follow and modify, perhaps. Otoh, your version would probably have fewer curlies, so maybe in the end your way is easier. Anyway, those templates might come in handy in some other situation which is less squirrely than this one. Mathglot (talk) 06:43, 26 July 2025 (UTC)
- Could this be added as a parameter to the standard cite book/cite journal templates? ARandomName123 (talk)Ping me! 00:03, 27 July 2025 (UTC)
- Yes, I think that's a possibility... maybe in the future after further discussion, and once the exact functionality has been ironed out? Pineapple Storage (talk) 00:08, 27 July 2025 (UTC)
- Sure. Also, have you thought about having a "short" option for the template? Something like {{ProQuest}} (ProQuest 734005592) or {{EBSCOhost}} (EBSCOhost 129997295), where it would just display TWL link. That would be a shorter one that could be used in the |id= parameter in citation templates. ARandomName123 (talk)Ping me! 00:17, 27 July 2025 (UTC)
- It would fit those quite well, since ProQuest, EBSCOhost and the other similar templates are also paywalled or login-gated, like TWL. ARandomName123 (talk)Ping me! 00:18, 27 July 2025 (UTC)
- Yes, this is definitely something I'll add in as an option! Thank you for raising it! :) Pineapple Storage (talk) 00:26, 27 July 2025 (UTC)
- Sure. Also, have you thought about having a "short" option for the template? Something like {{ProQuest}} (ProQuest 734005592) or {{EBSCOhost}} (EBSCOhost 129997295), where it would just display TWL link. That would be a shorter one that could be used in the |id= parameter in citation templates. ARandomName123 (talk)Ping me! 00:17, 27 July 2025 (UTC)
- Yes, I think that's a possibility... maybe in the future after further discussion, and once the exact functionality has been ironed out? Pineapple Storage (talk) 00:08, 27 July 2025 (UTC)
Discussion at Wikipedia:Village pump (miscellaneous)
editMarkup | Renders as |
---|---|
|
Full access available to users of The Wikipedia Library. |
- Please see also the discussion at Wikipedia talk:WikiProject Templates#New(-ish) Wikipedia Library access template. Pineapple Storage (talk) 08:39, 26 July 2025 (UTC)
- How would this work when a particular source withdraws from the arrangement, as has happened not infrequently? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:16, 26 July 2025 (UTC)
- Interesting! Unless there's something I'm missing, I think all that would happen is that the URL would then just take you to the regular source page, which would say "Log in through your institution" (or similar) where before it would have said "Download PDF"/"Read full text" etc. For example, this book is not available via TWL, but the template still generates a usable output:
Markup | Renders as |
---|---|
{{twlac|doi=10.4324/9781315675541}} |
Full access available to users of The Wikipedia Library. |
- ie. a TWL-formatted link that doesn't actually provide TWL access. I think the only solution for this would be to remove this template from the citation whenever a non-functioning/expired version is found, because if TWL doesn't provide access then this template would just be a duplication of (eg.) the
|url=
parameter in a citation template, so it doesn't add any value.Alternatively, a function similar to|url-status=deviated
could be added (maybe using the existing|2=
/|access=
parameter), so that if a source stops being available you can edit the template to indicate this (eg.|access=expired
) and the template then won't display at all, but there would still be a record in the wikitext that the source was originally accessed through TWL. (I'm not sure in what context that information would be useful/necessary, but it's still a possibility.) Pineapple Storage (talk) 12:02, 26 July 2025 (UTC)- If there is otherwise consensus for something of this nature, then I do not see expiring TWL partners as a deal-breaker. We have an analogous situation with interlanguage links created by use of Template:Ill: when someone creates a page at en-wiki that is the target of {{ill}}, the wikilink goes blue and the template is no longer needed, and Cewbot task #1 finds them and converts them to plain wikilinks. A bot task modeled on Cewbot could be created to convert your template in the same manner, after a partner was no longer on board. Mathglot (talk) 16:36, 26 July 2025 (UTC)
- ie. a TWL-formatted link that doesn't actually provide TWL access. I think the only solution for this would be to remove this template from the citation whenever a non-functioning/expired version is found, because if TWL doesn't provide access then this template would just be a duplication of (eg.) the
Village pump discussion follow-up
editJust a note regarding the point raised by @Pigsonthewing at the recent village pump discussion about this template. To complement the "No access" option I added last week, I've now also added an optional date parameter which appends "as of [date]" to the access note. (See documentation for fuller explanation and examples.)
This won't eliminate the possibility of TWL links expiring/going out of date if TWL loses access to a provider, but it should at least provide some warning to users; transclusions with older dates could be checked, and then changed to |access=none
(with a more current date) if the TWL link no longer works.
Does this go some way to solving the potential issue with ageing links? I'm very open to further suggestions either way. Pineapple Storage (talk) 16:32, 12 August 2025 (UTC)