Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

  $view = views_get_view('view_one');
  $contents = $view->result;

  foreach($contents as $content) {
    $nodes[] = $content->node_field_data_field_B_content_nid;

  if (isset($nodes)) {
    $args = implode(',' , $nodes);
    $view = views_get_view('linked_map');

    $markup_map = $view->render($args);

  else {
    $markup_map = '';

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.

share|improve this question
what order is it finally being displayed in? – Jimajamma Apr 4 '12 at 14:44
It is displaying by date created I believe, just as a default if I remove all sorting criteria – user1311807 Apr 6 '12 at 19:23

Draggable Views will let you define your own manual sort, and keep it consistent across different displays.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.