183231bcb<p><span>I have a MediaWiki question!<br><br>I frequently find myself needing to do the following:<br>a)Add a page to Category X, where X is dependent on a parameter<br>b)Add Category X to Category Y, where Y is dependent on the same parameter as part (a)<br>c)Add Category X to Category Z, which is not dependent on a parameter.<br><br>I can automate the first step using a simple template that contains </span><code>[[Category:Something with my parameter]]</code><span>, but I want help automating the next two steps.<br><br>I realize I'm maybe being a bit vague, so let me clarify with a concrete example (the example that inspired this question).<br><br>When </span><a href="https://transfem.social/@comicsbyxan" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@comicsbyxan</a> published <a href="https://pandorastale.com/2024/07/10/chapter-11-front-cover/" rel="nofollow noopener noreferrer" target="_blank">Chapter 11 of Pandora's Tale</a>, I made the <a href="https://pandorastale.wiki/wiki/The_Night_Shift#Characters_Appearing_in_This_Chapter" rel="nofollow noopener noreferrer" target="_blank">corresponding wiki article</a><span>. The chapter was the first appearance of new character Amelia, so I wanted to<br>* List in the chapter article that it was the first appearance of Amelia.<br>* Include the chapter article in </span><code>Category:Amelia appearances</code><span> <br>* Include </span><code>Category:Amelia appearances</code> in <code>Category:Amelia</code><span><br>* Include </span><code>Category:Amelia appearances</code> in <code>Category:Chapters by character appearances</code><span><br><br>The first two bullet points I can do simultaneously, </span><a href="https://pandorastale.wiki/wiki/Template:A" rel="nofollow noopener noreferrer" target="_blank">thanks to the simple "appearances" template.</a>. I just add</p><pre><code>{a|Amelia}</code></pre>To the article on Chapter 11. But I have to do the third and fourth bullet point manually. While that's not a big deal to do once, I have to do it for every new character Xan adds to the comic. Chapter 10 <a href="https://pandorastale.wiki/wiki/Echo,_Part_2#Characters_Appearing_in_This_Chapter" rel="nofollow noopener noreferrer" target="_blank">introduced nine new characters at once</a><span>, so I had to do it nine times.<br><br>Is there a way to soup up my {a} template so that when I type, for example, </span><code>{a|Example New Character}</code>, it automatically creates a page for <code>Category:Example New Character appearances</code> and includes it in both <code>Category:Example New Character</code> and <code>Category:Chapters by character appearances</code><span> ? Is this the kind of thing I should to learn Lua Modules for or is there a way to do it purely with wiki markup?<br><br>The hard part seems to be that I want to invoke a template in one article and have it modify a </span><i>different</i><span> page. I haven't found any wiki functions that can do that.<br><br></span><i>UPDATE 2</i><span><br>I fixed it! <br></span><a href="https://pandorastale.wiki/wiki/Template:A" rel="nofollow noopener noreferrer" target="_blank">Here's the code that makes it work</a><pre><code>[[{{{1}}}]][[Category:{{{1}}} appearances]]{{#if:{{{new|}}}|{{#createpageifnotex:
Category:{{{1}}} appearances
|<nowiki>[[Category:</nowiki>{{{1}}}<nowiki>]][[Category:Chapters by character appearances]]</nowiki>
}}|}}</code></pre><span><br><br></span><a href="https://transfem.social/tags/MediaWiki" rel="nofollow noopener noreferrer" target="_blank">#MediaWiki</a> <a href="https://transfem.social/tags/Wiki" rel="nofollow noopener noreferrer" target="_blank">#Wiki</a> <a href="https://transfem.social/tags/Miraheze" rel="nofollow noopener noreferrer" target="_blank">#Miraheze</a> <a href="https://transfem.social/tags/Wikis" rel="nofollow noopener noreferrer" target="_blank">#Wikis</a> <a href="https://transfem.social/tags/TechHelp" rel="nofollow noopener noreferrer" target="_blank">#TechHelp</a> <a href="https://transfem.social/tags/TechQuestions" rel="nofollow noopener noreferrer" target="_blank">#TechQuestions</a> <a href="https://transfem.social/tags/PandorasTale" rel="nofollow noopener noreferrer" target="_blank">#PandorasTale</a> <a href="https://transfem.social/tags/PandorasTaleWiki" rel="nofollow noopener noreferrer" target="_blank">#PandorasTaleWiki</a> <a href="https://transfem.social/tags/Lua" rel="nofollow noopener noreferrer" target="_blank">#Lua</a> <a href="https://transfem.social/tags/Scribunto" rel="nofollow noopener noreferrer" target="_blank">#Scribunto</a><span><br><br>RE: </span><a href="https://transfem.social/notes/a12wxwqpigwk00vv" rel="nofollow noopener noreferrer" target="_blank">https://transfem.social/notes/a12wxwqpigwk00vv</a><p></p>