Help talk:Duplicate parameters

From WikiProjectMed
Jump to navigation Jump to search
WikiProject iconWikipedia Help NA‑class Low‑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.
LowThis page has been rated as Low-importance on the project's importance scale.

Intended double assignment

Is there any possibiltiy to exclude a template from being listed in case the double definition is for this particular template (not only one instance but globally) intended and meaningful? Regards Draco flavus (talk) 08:40, 16 February 2021 (UTC)[reply]

@Draco flavus: No. Do you have an example of such a template? PrimeHunter (talk) 08:58, 16 February 2021 (UTC)[reply]
@PrimeHunter: Not on this wiki (however there is one on the Polish wikisource). It is still on experimental stage. The idea behind it is: called without a special parameter reference it simply takes the last instance of the named parameter, called with the parameter reference inherits all parameters from the referenced instance of the template above the other special (pseudo)-parameter CUT.

Page one:

{{MyTemplate
|parameter1=abc
|parameter2=def
|parameter3=ghi
|parameter4=jkl
|CUT=---
|parameter1=mno
|parameter5=stu
}}

On another page:

{{MyTemplate
|reference=Page one
|parameter2=pqr
}}

which effectively evaluates to:

{{MyTemplate
|parameter1=abc
|parameter2=pqr
|parameter3=ghi
|parameter4=jkl
}}

It works quite fine, however Page one is reported as page with duplicated definition of a parameter. For the productive stage it is simply not elegant and maybe prone to other undesired effects.

Draco flavus (talk) 09:25, 16 February 2021 (UTC)[reply]

@Draco flavus: You didn't give a real example. Even with the duplicate warning appearing I don't know how MyTemplate could be coded, unless it reads the wikitext of Page one and parses it instead of letting MediaWiki do it. Page one itself could say <includeonly>|parameter1=abc</includeonly> to avoid the warning on that page. PrimeHunter (talk) 11:38, 16 February 2021 (UTC)[reply]
@PrimeHunter: Thanks, The teplate is here {{s:pl:Template:Dane tekstu2}} which calls the function (coded in Lua) {{s:pl:Modul:Sandbox/Draco flavus/TestFields4|FindFields}} . It reads the source code of the page. Regards Draco flavus Draco flavus (talk) 13:11, 16 February 2021 (UTC)[reply]
The links are s:pl:Template:Dane tekstu2 and s:pl:Module:Sandbox/Draco flavus/TestFields4. As I suspected, it reads the wikitext and parses it by itself. That's not really how MediaWiki is supposed to be used. If you do your own parsing then there are many ways to avoid the duplicate argument issue. You can just choose a format which doesn't have a duplicate argument when MediaWiki parses it. PrimeHunter (talk) 13:28, 16 February 2021 (UTC)[reply]

What about duplicated issn numbers when they are already present in an original reference

What about duplicated issn numbers when they are already present in an original reference of a scientific paper directly fetched from the publisher site? What number to keep? The first one or the second one? To avoid to loose information, I often create two | issn = | fields, being aware that only the second field will appear in the reference of the paper on the page.

The script findargdups used to clean duplicate template arguments removes the first occurrence of the issn number. is it the right way to proceed?

How to best tackle this kind of issue with a reference arising from the publisher of the paper. In advance, thanks for your answer. Shinkolobwe (talk) 19:05, 19 February 2022 (UTC)[reply]

Keep the ISSN that matches the source you are citing. See the documentation for {{Cite journal}} if you are using that template. – Jonesey95 (talk) 18:00, 20 February 2022 (UTC)[reply]
Mea culpa; I'm the one who took out the duplicate issn's. However, I've since discovered that {{cite journal}} has an "eissn" parm for the electronic version of the issn. (documentation here). I've restored the ones I took out as "eissn"s, here & here. Davemck (talk) 18:19, 20 February 2022 (UTC)[reply]