title: wordpress 3.5 media manager - add my own backbone.js views
body: <p>I am currently trying to utilize the new WordPress 3.5 media manager which uses backbone.js to create and populate its modal window.</p>
  
  <p>What I want to do is: a user clicks upload button, media manager pops up, user selects image, presses insert, image is then saved to custom field.</p>
  
  <p>All of that already works, the only thing that I would like to change is to populate the sidebar of the media uploader (were user can add caption, title, select size, etc) with my very own template.</p>
  
  <p>I already read dozens of tutorials on how to work with backbone but am now a little stuck. here is my some of code so far:</p>
  
  <pre><code>//defined earlier:
  var frame;
  
  //on click:
  
  if ( file_frame )
  {
      file_frame.open();
      return;
  }
  else
  {
      // Create the media frame.
      file_frame  = wp.media(
      {
      frame:   'select',
      state:   'mystate',
      library:   {type: 'image'},
      multiple:   false
      });
  
      file_frame.states.add([
  
      new media.controller.Library({
          id:         'mystate',
          title: 'my title',
          priority:   20,
          toolbar:    'select',
          filterable: 'uploaded',
          library:    media.query( file_frame.options.library ),
          multiple:   file_frame.options.multiple ? 'reset' : false,
          editable:   true,
          displayUserSettings: false,
          displaySettings: true,
          allowLocalEdits: true,
            //AttachmentView: ?
  
      }),
      ]);
  
  file_frame.open();
  
  }
  </code></pre>
  
  <p>I have also tried registering my own template like this:</p>
  
  <pre><code>media.view.Attachment.mySidebar = media.view.Settings.AttachmentDisplay.extend(
  {
      className: 'attachment-display-settings',
      template:  media.template('avia-choose-size')
  });
  </code></pre>
  
  <p>but the problem is: I dont know were to load only this template instead of the original sidebar. passing it as AttachmentView parameter obviously doesnt work since it replaces the whole template and not just the sidebar.</p>
  
  <p>Anyone with some backbone.js experience who can help?</p>