Module talk:User:Victar/collapse-quote
Latest comment: 5 years ago by Victar
@Erutuon, I had this working so well as just a template, until I turned it into a module, and now my lists are broken. Could you tell me what I'm doing wrong? --Victar (talk) 01:14, 22 November 2018 (UTC)
- I guess you mean this bit?
**** {{desc|sa|tr=múraḥ|pos=pl.}}{{collapse-quote|...}} ***** {{desc|sa|tr=āmúraḥ|pos=pl.|der=1}}, {{l|sa|tr=āmúrim|pos=acc.sg.}}{{collapse-quote|...}}
If I stick it in Special:ExpandTemplates and look at the resulting wikitext, it has an extra newline after the first{{collapse-quote}}
. So the second line is assigned to a new list. and a bunch of bullets are displayed. Aha, the template page had a newline after the invocation of the module. Gotta watch your whitespace. — Eru·tuon 03:53, 22 November 2018 (UTC)- It's always the simplest of mistakes. Thanks, @Erutuon! -- Victar (talk) 04:07, 22 November 2018 (UTC)
@Erutuon, I'm trying to incorporate Module:Quotations, but I'm getting Module:Quotations:49: attempt to call method 'getParent' (a nil value):
. Do you think you could have a look? --Victar (talk) 07:40, 23 November 2018 (UTC)
- @Victar: That's because the function expects a frame object, which has a
getParent
method. I've madeexport.Create
take a table of args as your module requires, because the only thing fromframe
it ever uses isframe:getParent().args
. — Eru·tuon 16:08, 23 November 2018 (UTC)- Hmm, @Erutuon, I can't pass
lang
orargs[1][i]
to|1=
, and when I manually pass"sa"
to it, it doesn't format it using Module:Quotations/sa/data. --Victar (talk) 16:26, 23 November 2018 (UTC)- Sorry, I don't understand. Can you put examples of whatever's going wrong on the documentation page of this module? — Eru·tuon 16:43, 23 November 2018 (UTC)
- @Erutuon, No matter what I try, I get
Lua error in Module:languages at line 389: The function getByCode expects a string as its first argument, but received a table.
For the latter problem, I'm gettingRV 1.068.10
instead ofṚgveda 1.068.10
.- I guess I've figured out what you mean.
args[1]
is a string and indexing a string returnsnil
(because it returns the same result as indexing thestring
library), soargs[1][i]
is alwaysnil
. And the result ofm_languages.getByCode(args[1])
is a table, so if you pass it as argument ofm_languages.getByCode
, you get a complaint. I don't know what's going on with the second bit. — Eru·tuon 17:31, 23 November 2018 (UTC)- @Erutuon: Hmm, so how should I be passing the language code? --Victar (talk) 18:52, 23 November 2018 (UTC)
- The way it's currently being passed, as a string. — Eru·tuon 19:51, 23 November 2018 (UTC)
- Ah, got it now, thanks. --Victar (talk) 19:56, 23 November 2018 (UTC)
- The way it's currently being passed, as a string. — Eru·tuon 19:51, 23 November 2018 (UTC)
- @Erutuon: Hmm, so how should I be passing the language code? --Victar (talk) 18:52, 23 November 2018 (UTC)
- I guess I've figured out what you mean.
- @Erutuon, No matter what I try, I get
- Sorry, I don't understand. Can you put examples of whatever's going wrong on the documentation page of this module? — Eru·tuon 16:43, 23 November 2018 (UTC)
- Hmm, @Erutuon, I can't pass