title: Test to see if you are in a specific content block in TinyMCE and not allow a plugin to add to that content block if in it
body: <p>So I have a TinyMCE form on my page and it is pre-filled with "sections" (divs with specific class names).</p>
  
  <p>I have a couple of plugins that will add to TinyMCE with more "sections".</p>
  
  <p>I need it so when I push the plugin button it will test to make sure the cursor is not inside a "section" and paste a "section" inside another "section".</p>
  
  <p>Not sure the direction I need to take to accomplish this.  Any help would be great.</p>
  
  <p><strong>more info:</strong>
  So below is an example of a plugin that adds a button that just inserts a simple dov into the editor at the selection/cursor.</p>
  
  <pre><code>ed.addButton('pluginbutton', {
      title : 'MyPlugin',
      image : 'img/test.png',
      onclick : function() {
          ed.selection.setContent('&lt;div&gt;test&lt;/div&gt;');
      }
  });
  </code></pre>
  
  <p>I am currently thinking that <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/onBeforeSetContent" rel="nofollow noreferrer">onBeforeSetContent</a> is the API event handler I need to set to process whether or not I am in another section and if so send a message to the screen.  If not just do the setContent method.  I am not sure exactly how to set that up though so I am still figuring that out.  Any help here?</p>