I have developed a module for joomla 2.5 and it works just fine, the thing is I don't want it to be rendered when a certain view of a component is displayed but that view is not a menu link so I can't tell my module not to render when I don't want it to.
2 Answers
One issue that you might have with "check for the component and view and not render itself in certain cases" is that if the module is in a module position that is supposed to "collapse" when there are no modules in it (e.g. a right or left column), it won't collapse because the module is still assigned (even though it's not rendering anything).
The issue is to do with where the decision is made to display the module. Is it a question of the module itself deciding when to render, or should the logic be somewhere else, that determines "on this page, should a particular module appear?". I suggest the latter.
A good solution for this is MetaMod Pro that allows you to build in conditions that determine whether other modules should appear on the page. You then put in a snippet of PHP to do the detection.
So the snippet might be:
if (! ($option == 'com_mycomponent' and $view == 'myview') ) return XXX;
// replace XXX with the module id of the module you want to disappear.
i.e. "if we're not on a page with mycomponent and myview, show module XXX".
Tip: the Pro version will allow the module to completely disappear if it's not included. The free version may leave some HTML behind.