I want to add the insert web edit button but only when the current rendering has a datasource item of a specific type. I see two ways to do this. I can add an edit frame to the view that shows up if the datasource item is not null. This would mean that there would basically be 2 frames for the rendering though, the normal one that goes around renderings and the one I'm adding manually. The other option is to create a custom insert button. Currently I'm attempting to do this and overriding the QueryState however no matter what the CommandContext
passed in seems to have items. Is this even a good idea?
The ultimate goal is that I want to use the insert button but if a content editor removes the datasource then the insert option will target the current page. If I can change the insert button to behave like the button that adds or changes associated content that would be even better. If this is something that can be done out of the box I'd like to know the way to do that.