A newer extension capable writing data from templates into database tables is Extension:Cargo, which is easy to install and good if you trust all your users with write permissions not to do malicious stuff to your database, otherwise go with Semantic MediaWiki.
Ugly and very limited hack: If the template only adds one piece of information and you are okay messing with category sorting and you do not need to run aggregation operations, you might be able to put this single piece of information into the sort key. [[Category:example|{{{information}}}]]
. You can then retrieve {{{information}}}
from an API query action=query&list=categorymembers&cmtitle=example&cmprop=sortkey|sortkeyprefix
or directly from the categorylinks
table.
1Semantic MediaWiki can do that (and much, much more). Not trivial to set up, though. – Tgr – 2018-06-15T14:08:14.900