# orion.navigate.openWith

The `orion.navigate.openWith` service is used to associate a registered editor with a registered content type. Once this association has been made, the editor will be presented as a choice in the actions menu (gear menu) beside files of that content type. (If it's the only available editor for that file, it will be used to generate the link when the file is clicked).

By default, the Orion client UI provides an editor with ID `orion.editor`, to be used for editing source code. You can refer to this editor ID when you want to associate a new content type with the Orion Editor.

## Service methods

None. This service is purely declarative.

## Service attributes

Implementations of `orion.navigate.openWith` must define the following attributes:

editor
  `String` The ID of the editor we want to associate. This must match exactly the editor's ID as given in orion.edit.editor.
contentType
  `String[]` An array of one or more content type IDs that will be associated with the editor.

## Example

Here is a sample plug-in that associates the Orion Editor with the `"text/x-php"` content type. This example assumes that the `"text/x-php"` type has been previously registered with the orion.core.contenttype service.

      var provider = new orion.PluginProvider();
      provider.registerServiceProvider("orion.navigate.openWith", {},
        {  id: "orion.editor",
           contentType: ["text/x-php"]
        });
      provider.connect();

When this plug-in is installed, the user will see the Orion Editor as an available target in the actions menu beside files of the PHP content type: