Things that work:
- Using <templatedata> directly on the template (Template:Example).
- Using <templatedata> on a subpage of the template (Template:Example/doc) which is transcluded inside the template
Thing that doesn't work:
- Using <templatedata> on a page on a different namespace than the template (Template Documentation:Example) which is transcluded inside the template.
On our wiki we use the LinkSuggest extension, and it's handy to autocomplete template names, but then the template documentation pages (that we historically maintained on a subpage of the template and transcluded inside the template) were appearing as suggestions, polluting the results specially when several templates with a common preffix were being requested.
I had the idea of creating a custom namespace and move all the documentation pages to the new namespace, updating the transclusion of the documentation to point to that namespace instead. However, now I find that TemplateData information is not available from the template, while it is for the documentation page.
You can see the problem here with the api query, on the custom namespace where the documentation (and template data) resides: https://www.wikidex.net/api.php?action=templatedata&titles=Documentaci%C3%B3n%20de%20plantilla:Personaje&format=jsonfm
While it displays nothing on the template itself: https://www.wikidex.net/api.php?action=templatedata&titles=Plantilla:Personaje&format=jsonfm
This is working when transcluding from the subpage: https://test.wikidex.net/api.php?action=templatedata&titles=Plantilla:Personaje&format=jsonfm