Of course, having two templates like you said is a possibility (and perhaps the optimal way).

It still has a downside, however – people have to remember that in certain scenarios you have to use a special template (even though the common one will – confusingly – appear correct on the page where you configure the editnotice etc.).

Anyway, thanks for the answer.
Marcin

From: Thiemo Kreuz <thiemo.kreuz@wikimedia.de>
Sent: Friday, November 29, 2024 3:11:21 PM
To: Wikitech-l <wikitech-l@lists.wikimedia.org>
Subject: [Wikitech-l] Re: Checking if template is rendered outside page content
 
I don't think this is possible, sorry. Why not have a special template
for use on special pages? Making code more complicated just to avoid
"duplication" sounds like something we discuss in software development
all the time – and typically try to avoid.

The two templates can still share most of their code, e.g. the special
one can call the normal one and add the mentioned mw-parser-output
wrapper.

Kind regards
Thiemo
_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/