Can an extension detect that a given article has been transcluded from a given
namespace? Here's why I ask.
On our wiki, we have an extension with a special restriction: it can be used
only in a specific namespace, N. So it contains logic like this:
if ($title->getNamespace() == NS_N) {
// render
} else {
// display an error message
}
This works fine, but I would also like to permit articles in namespace N to be
transcluded into other namespaces:
{{N:My article}}
This fails the extension's "Namespace = N" test and displays the error message.
So I really want the logic to be:
if ($title->getNamespace() == NS_N || $title was transcluded from namespace N) {
// render
} else {
// display an error message
}
Is this doable?
Thanks,
DanB
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l