Hi,
in our wiki asphalt.fandom.com we have several pages that are categorized by a template, depending on the page name. Reduced example:
Template {{Chronology}}: Is inserted on a single page named "2020 Page" with {{chronology|article = 2020 Page}}
. The names of all pages containing {{Chronology}} start with a year.
Wikitext {{Chronology}}:
{{#ifeq:{{PAGENAME}}|{{{article|}}}| [[Category:{{first word|{{{article}}}}}]] }}
This categorizes in "2020" if the page name is the same as article
when the page is saved.
However, the single pages are also displayed dynamically (with {{#dpl:}}) within other "meta" pages if they have the category "2020". As {{Chronology}} is now on a metapage whose name is not the same as article
, the #if statement prevents this metapage from getting all the categories of the contained single pages – at least this was the plan.
In reality all single pages unfortunately lose their categories as soon as they are listed on a metapage. Apparently, {{Chronology}} is parsed again on the metapages, and as the metagepage name doesn't match article
, there is not only no categorization for the metapage (correct), but the categorizations of the contained single pages are even reverted (unwanted).
I'd like to have that {{Chronology}}
- categorizes all single pages in which it is inserted
- does NOTHING if those single pages containing {{Chronology}} are transcluded a second time.
Can anybody help me there?
The template method was chosen to be able to add other categories later.