@Sgconlaw: when the module sees a value in the first positional parameter, it tries to use it as the language code for the quote, as it would with the {{quote}}
template. I suspect it has something to do with "1" being in the list given to |propagateparams=
. Perhaps you need to take "1" out of that list and just make sure that your template code passes |1=
to |page=
There is currently a module error at Wiktionary:Quotations/Templates/English T–Z due to this. I checked a transcludes in an entry, and was able to get an error in preview by changing |page=
to |1=
. Chuck Entz (talk) 23:54, 9 February 2024 (UTC)
|propagateparams=
and |allowparams=
work as I’m unsure what parameters need to be explicitly specified under each one. I’ll need to ask @JeffDoozan for help here. Specifically, if I wish to designate |1=
as a synonym for |page=
and other numbered parameters, where do I specify them? Does the order of the parameters listed under |propagateparams=
and |allowparams=
matter? — Sgconlaw (talk) 04:55, 10 February 2024 (UTC)|propagateparams=
basically tells the module to take the listed parameters as its own, while |allowparams=
basically tells the module not to throw an error if any parameter on the list is present but not in the module's list of permissible parameters. That means you would want to include every parameter possible in |allowparams=
, but be selective with |propagateparams=
. I suspect what you want to do here is leave |1=
out of |propagateparams=
, and assign |1=
to |page=
if |1=
is present. I'm a little fuzzy about whether you would need to include |page=
in |propagateparams=
, but I believe you would. Perhaps @Benwing2 can explain, since he wrote the code. Chuck Entz (talk) 06:30, 10 February 2024 (UTC)|foo = {{foo|}}
, you can add "foo" to |propagateparams=
. That's it - nothing else should ever go in |propagateparams=
. If you prefer writing the full line, you can keep doing so and never use |propagateparams=
.|allowparams=
is important because it tells the module when it should warn the user that they've made a typo, used the wrong paramater name, or are trying to add data the template is just going to ignore. If you've written {{{bar}}}
or {{{bar|
anywhere in the template, add "bar" to |allowparams=
.|pageparam=
then "page", "pages" and the synonyms you listed in pageparam will also be automatically included, and don't need to be manually listed in propagateparams.
{{RQ:Spenser Fowre Hymnes}}
properly? — Sgconlaw (talk) 22:28, 14 February 2024 (UTC)
{{RQ:Spenser Fowre Hymnes}}
is perfect! It looks like you've got the hang of it! JeffDoozan (talk) 00:23, 15 February 2024 (UTC) @JeffDoozan unfortunately not. In {{RQ:Young Centaur}}
I can't get the chapter name to display when the page number is specified, even when I have put "1" in |allowparams=
. What's wrong? Also, if I have used |pageparam=
and |textparam=
, do I still need to put "1" and "2" in |allowparams=
?
— Sgconlaw (talk) 16:35, 15 February 2024 (UTC)
|chapter = The chapter containing page {{{page|}}}
displays as expected. For development and debugging, you can build the templates exactly as you've always done, with |allowparams=*
and, when everything works, figure out what should go in |propagateparams=
and |allowparams=
. With {{RQ:Young Centaur}}
, you shouldn't include chapter to |allowparams=
because you're generating the |chapter=
inside the template so anything a user passes to |chapter=
will just be ignored.{{RQ:Young Centaur|chapter=THIS TEXT WILL NEVER BE DISPLAYED|page=256}}
|pageparam=1
and |textparam=2
have already been set, do I still need to include |allowparams=1,2
? — Sgconlaw (talk) 19:45, 15 February 2024 (UTC)
|pageparam=
or |textparam=
does not need to included manually in |allowparams=
because by listing a parameter in either of those lists, you're already telling the module that it's an allowed parameter.|allowparams=
exists: everything inside of double {{...}}
or triple braces {{{...}}}
is resolved to text before the module code is run, so |chapter = {{#ifexpr:{{{page|}}}{{{pageref|}}}{{{1|}}}<100|First Chapter|Second Chapter}}
simply becomes |chapter=First Chapter
. This means that athough the module will see all of the parameters provided, it has no way of knowing if {{{page}}}
or {{{pageref}}}
was part of the template code, or if they are parameters that were accidentally included by the user. Setting |allowparams=
is the way to tell the module that those parameters exist for a reason and that it shouldn't generate an error when it sees them. JeffDoozan (talk) 20:24, 15 February 2024 (UTC)