Topic on Extension talk:TemplateData

XanonymusX (talkcontribs)

I have read that it should be possible now to define a custom format, but I cannot find any information about how to do that on the page. Does it still need to be updated?

Jdforrester (WMF) (talkcontribs)
XanonymusX (talkcontribs)

Thank you for the link! So now I have a concrete question about the format: in my case, the template is a combination of unnamed (thus, numbered) parameters, which should always be inline, and named parameters, which should be formatted as block. Is there any possibility to specify separate formats for selected parameters in TemplateData? I am thinking of a potential combination of paramOrder and format, or something like that.

Jdforrester (WMF) (talkcontribs)
in my case, the template is a combination of unnamed (thus, numbered) parameters, which should always be inline, and named parameters, which should be formatted as block. Is there any possibility to specify separate formats for selected parameters in TemplateData?

No. This sounds like a very odd use-case. I would strongly discourage this pattern of wikitext.

XanonymusX (talkcontribs)

Besides the fact that this might be used much more frequently than one can think, there simply is no other way, because having a list of short unnamed parameters as a block makes the source look ridiculous; at the same time, however, inline is no solution, as the long list of other parameters would make the source unreadable if put on one line. Certainly, the better of the two is block, so other users will just have to correct the source by deleting the unnecessary breaks, which seems like an easy task. A possibility to define the format correctly already in TemplateData would however be much appreciated.

XanonymusX (talkcontribs)

Actually, I just tried it, and it seems that the unnamed parameters will be put inline automatically, even if block is specified! In that case everything is fine!

Whatamidoing (WMF) (talkcontribs)

Can you give an example of this? I don't remember seeing it before.

XanonymusX (talkcontribs)

Well, the use case is de:Vorlage:Charttabelle. TemplateData is of course not able to follow the usual order of the parameters in the example given, but at least it leaves all the unnamed parameters in one line.

Jdforrester (WMF) (talkcontribs)

I don't understand. TemplateData is definitely able to write out in the order of parameters, except that templates's TemplateData block is invalid so it won't work. If you click "Vorlagendaten verwalten" to load the editor, it will warn you:

Ungültiges JSON-Format. Du kannst diese Operation zum Korrigieren abbrechen, die aktuellen <templatedata>-Tags löschen und es erneut versuchen oder mit dem Ersetzen der aktuellen Vorlagendaten durch neue fortfahren.

I'm not quite sure how you've managed to save past the error. The TemplateData block lacks the customary whitespace which makes reading it hard, and the descriptions try to use wikitext which won't work, but I'm running between meetings so I can't see how to obviously fix it.

XanonymusX (talkcontribs)

That has nothing to do with this template, but with de:Vorlage:TemplateData, which makes the Vorlagendaten-verwalten button useless (not my invention). The TemplateData works fine with this template (except obviously for tasks T52407 and T178341 that need to be solved in order to actually allowing the use of the complete template in VE).

But let me give you more detail. The usual parameter order of this template is (traditionally) the following:

{{Charttabelle

|DE|AT|CH|UK|US|Quellen =

| Art =

| INHALT =

}}

TemplateData currently makes it look like this:

{{Charttabelle|DE|AT|CH|UK|US

|Quellen =

| Art =

| INHALT =

}}

In the end I do not mind, it still makes sense.

Jdforrester (WMF) (talkcontribs)

Well, if the editor hadn't been broken, I would say "just drag the parameters into the order they should be in and they'll be saved that way", but of course it's not helpful. :-(

Maybe that meta-template can be deleted?

XanonymusX (talkcontribs)

I have now changed the order (which is working absolutely fine, just edit Vorlage:Charttabelle/Doku)! :) But what I actually meant with order was the predefined position of some parameters in the traditional use of the template as shown above. I really do not like to have the unnamed parameters in the same line as the template name, but I can live with it.

I doubt that the meta-template will be deleted, even if it was heavily criticised just some days ago. It is already used quite a lot and I have to say that I like the visuals of it, otherwise I would not have used it for my template.

Whatamidoing (WMF) (talkcontribs)

PerfektesChaos, do you have any idea what the JSON problem is with Vorlage:Charttabelle?

PerfektesChaos (talkcontribs)

Showing up incidently today.

No idea at the first glance, but it seems to me the local German de:WP:VWS would have been a faster and more specialised help desk ttan internnational stage.

I'll continue on loval level and solve the problem over there; may be regarded as "solved" here.

Reply to "Custom format"