Jump to content

Extension talk:TemplateData/2022

Add topic
From mediawiki.org

TemplateData editor and paramOrder

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


I have a template that I created in MW 1.31 (TemplateData 0.1.2). The TemplateData editor does not create the paramOrder object, but the order still works, because it adheres to the order in which the parameters are defined in the source code.

However, in my MW 1.35 this no longer works. The params are ordered based on their name instead. Since the editor does not create the paramOrder, I now have to manually add it in the source code for each template. I would like to avoid that and don't know if it's just an issue in my wiki that the paramOrder object is not created automatically by the editor? MLRodrigue (talk) 11:39, 31 January 2022 (UTC)Reply

I wasn't involved back then and can't tell when this broke, and where. It's potentially related to an unrelated change in Parsoid. But I'm aware of this issue. We fixed it just recently via gerrit:700350. This is part of MediaWiki 1.37, but not earlier, unfortunately. I think the best option you have (other than using 1.37) is to add a specific paramOrder to each template. The TemplateData editor isn't designed to do this automatically. Thiemo Kreuz (WMDE) 12:16, 31 January 2022 (UTC)Reply
Okay, then I know what to do. Thanks for the prompt answer! MLRodrigue (talk) 12:27, 1 February 2022 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

TemplateData Editor suggested values input field not showing

[edit]

So I've been learning to make templates over the last week or so, manually at first then I started to read about the TemplateData Editor and the possibility of adding a limited range of suggested parameter values by way of the suggested values field. However it just will not show whether I use the editor on an existing template or a new one from scratch. I'm running a recently updated MW 1.37.2 (previously 1.35) with extension versions that came with it, PHP 7.4.28, TemplateData Extension 0.1.2. Tried changing the skin, I normally use Citizen (1.17.4) but tried it with the vanilla, as installed, Vector 1.0.0, still no joy. I have updated the TemplateData Extension to 0.1.2 (3e7e798) 06:04, 1 June 2022. But alas nothing. Tried it with the 2010 wikitext editor, still nothing. I went onto Wikipedia and tried their TemplateData Editor which worked as advertised, so I know what to expect. I did find something on Phabricator about a bug with the suggested values filed which was reported April 2021, but that was different.

At my wits end - any suggestions?

Thanks MrSmith35 (talk) 02:26, 8 June 2022 (UTC)Reply

At the moment the suggested values feature is still opt-in. This will change in the near future. Until then you need to add $wgTemplateDataSuggestedValuesEditor = true; $wgVisualEditorTransclusionDialogSuggestedValues = true; to your LocalSettings.php. I hope that helps. Thiemo Kreuz (WMDE) 06:12, 8 June 2022 (UTC)Reply
Thanks for your quick reply Thiemo, much appreciated, worked a treat.
The suggested parameter values list appears as expected and I can edit existing lists. The drop down menu also works correctly in the insert template dialogue.
I have one minor issue, the insert Template dialogue works well except in my named User namespace. The dialogue appears and goes through the motions of doing what it's supposed to but after I hit apply no template is added to the article, but no error dialogue or warning appear. Though this is not that serious as I generally will be using templates in the Main namespace, is there a separate setting that I need to toggle to enable the dialogue in my User namespace? MrSmith35 (talk) 14:32, 8 June 2022 (UTC)Reply
Oh, that sounds like a bug. Unfortunately I can't reproduce it on my machine. Can you provide more information and maybe report it? Thiemo Kreuz (WMDE) 15:02, 8 June 2022 (UTC)Reply
Hi,
Yes I could, what do you need to know, please keep in mind I am a complete novice wrt MediaWiki and stuff like php. I can just about follow along with good instructions otherwise I get lost pretty quickly. Are there are specific logs I could easily find that might help, I couldn't see anything in the public logs on the wiki. My set up is on a Synology NAS - a custom install of MediaWiki as I couldn't get the Synology supported app working. I run it on Apache 2.4 with PHP 7.4 and MariaDB 10. MrSmith35 (talk) 13:44, 9 June 2022 (UTC)Reply
Does something appear in your browser's JavaScript console (Ctrl+Shift+I)? I currently don't have a better idea where to look for this kind of error. Maybe you continue and see if the issue persists, and report back later? Thiemo Kreuz (WMDE) 14:13, 9 June 2022 (UTC)Reply
Hi,
Yes there is an output in the console but nothing that comes up as an error related to the actions when adding a template neither in the Main namespace nor in the User namespace, both consoles look pretty much the same.
The problem I'm seeing might be completely unrelated to the TemplateData extension in as much as I did previously have an error in the User namespace adding pages that had a "/" in their name eg User:MrSmith35/sandbox - I read that on some setups the slash could cause errors with Apache 2.4, but I fixed that by adding something to the Apache server config - what I'm seeing with templates not rendering might be something to do with how my server is configured.
I don't need templates in the user namespace so for now I can live with it, see what happens. If you do think of anything that might help resolve this or come up with a suggestion of where we might find the error logging, then I'm more than happy to help in any way I can. If I get time I might try a docker install of MW on my Synology which might give me an easier ride through the installation process than the hodgepodge of methods I had to use to get it working. If the error occurs in docker then it's probably worth investigating.
Thanks again for your help and the great work on the extension. MrSmith35 (talk) 00:44, 10 June 2022 (UTC)Reply

Pull values from the TemplateData block?

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


I would like to create a DPL that lists all the templates in a category, along with the description listed inside their data block. Is this possible? BCreegan (talk) 20:22, 5 August 2022 (UTC)Reply

What is a DPL?
Searching categories is possible with CirrusSearch, even recursively with the deepcat: keyword. The TemplateData extension comes with its own action API called action=templatedata. You have probably see the documentation. These APIs can be combined with the generator feature of the query API. We improved this particular feature just recently. I hope this helps. Thiemo Kreuz (WMDE) 08:57, 6 August 2022 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

How to enable wikitext within descriptions?

[edit]

I find the limitation that all descriptions must be plain text to be incredibly limiting. I often want to link related articles in descriptions.


Apparently the German Wikipedia has figured out a way to have the descriptions rendered as wikitext ... I'd like to know how to do the same. push-f (talk) 09:18, 22 October 2022 (UTC)Reply

No, German Wikipedia figured out a way to have descriptions rendered as wikitext on the template documentation page – the actual TemplateData (used by VisualEditor etc.) still can’t contain links. See de:Vorlage:TemplateData#Verbesserte Präsentation for how the template documentation page and the actual TemplateData differ. Tacsipacsi (talk) 18:45, 23 October 2022 (UTC)Reply