Another option would be to use Event System
on Page Save
and interrupt the saving if the Page Template <-> Component Template
combination is not allowed. You can throw an exception with a meaningful message informing the Editors that what they're trying to achieve is not permitted.
The advantage of this approach is that you handle your specific case even before it's created VS throwing and exception from Templating or not rendering it at all (effectively masking the Component Presentation
). In other words, you have a clean slate as far as the PT/CT combinations goes, effectively having a clearer overview of the current state of the system.
Naturally, this also has drawbacks, for example it will get executed each time a Page
is saved slowing the system a bit, but the main concern is what about the already existing Pages which have the forbidden Component Template
. For those, you could use Core Service to do a quick search and remove the Component Presentation
from them.