Multiple formatters for a field collection - best approach? I'm building a site with a "function" content type, to manage a list of functions and their arguments. Because arguments can be zero or more, and have multiple properties (name, required, usage notes) it seems best to handle them as a field collection, using field collection table as the input widget. Therefore, on the node edit form for the "function" content type, the input widget would look something like this:



On the display side, I need to display the argument data in at least two ways: (1) in a table formatter provided by field collection table and (2) in an arbitrary "syntax" format, where only the arguments are output, but with some kind of visual indication of which arguments are required. So, something like this:



My questions:


What's the best way to add a custom formatter for the field collection (i.e. in code, in a field template of some kind, using the custom formatters module, etc.)?
What's the best way to output two instances of the field collection field, each in a different format?


I do have Display Suite installed on this site, if that helps. Also interested in any general advice if there's a better way to handle this use case.
This sounds like it would be best output as two separate views.  The first view would be set in your first format and the second in the other format.  Probably using a view template of some sort.  The issue is that the field collections attached to the node are actually referenced separately and you only know they belong to the same node because the field collection entity has a reference to the NID.

The view would reference by nid in the contextual filters.

The other option is to programmatically load the fields via the node.tpl.php file (assuming you are loading them on the node page). in which you simply gather the data via the $node object and display it as you need.

https://drupal.org/project/field_collection_views

https://api.drupal.org/api/drupal/modules%21node%21node.tpl.php/7

http://www.youtube.com/watch?v=_GlfYhsk3X0