Custom sort to preserve order of referenced nodes I have a node type that references other nodes. When viewing node of Content Type A, I have set up a view that displays all references to nodes of Content Type B on a gmap. 

This is the code from a template file that overrides the display of view_one; it calls the map in from another view.

&lt;?php
  $view = views_get_view('view_one');
  $view-&gt;set_arguments(array($fields['nid']-&gt;raw));
  $view-&gt;execute();
  $contents = $view-&gt;result;

  foreach($contents as $content) {
    $nodes[] = $content-&gt;node_field_data_field_B_content_nid;
  }

  if (isset($nodes)) {
    $args = implode(',' , $nodes);
    $view = views_get_view('linked_map');
    $view-&gt;set_display('map');
    $view-&gt;set_arguments(array($args));
    $view-&gt;execute();

    $markup_map = $view-&gt;render($args);

  }
  else {
    $markup_map = '';
  }
?&gt;


It displays beautifully. The only problem is I want to use numbered markers, so that the list is in the same order as the referenced nodes in the main view ("view_one"). Is there some way that I can either utilize a "sort" that won't rearrange the list, or write a custom sort that will preserve the existing order?

I am using the Views module version 7.x-3.1.
Draggable Views will let you define your own manual sort, and keep it consistent across different displays.