How can I turn several Fields into a menu via a View? I have 3 text Fields that I use for URLs, attached to a Panel Page. I'd like to create a menu with these URLs.

I've sort of done this with a View, by setting the Contextual Filters to use the node ID, then adding the Fields output and setting the Format to a pre-made Menu format I've used in the past. I've used Rewrite Results to make the &lt;a&gt; tag.

However, the issue is that all my fields are treated as a single menu item, not 3 individual ones.

Instead of the desired result being something like:

&lt;span class="menu-item"&gt;&lt;a href="url"&gt;Link Name&lt;/a&gt;&lt;/span&gt;
&lt;span class="menu-item"&gt;&lt;a href="url"&gt;Link Name&lt;/a&gt;&lt;/span&gt;
&lt;span class="menu-item"&gt;&lt;a href="url"&gt;Link Name&lt;/a&gt;&lt;/span&gt;


The result I get is:

&lt;span class="menu-item"&gt;&lt;a href="url"&gt;Link Name&lt;/a&gt;&lt;a href="url"&gt;Link Name&lt;/a&gt;&lt;a href="url"&gt;Link Name&lt;/a&gt;&lt;/span&gt;


Would anyone know how I can iterate through and Format each Field within a View?
OK, so the only way I could do this was to adjust the Features .module file to register both a theme and a CTools plugin:

/**
 * Implements hook_theme().
 */
function mycomponent_theme() {
  return array(
    'mycomponent_links_menu' =&gt; array(
      'path' =&gt; drupal_get_path('module', 'mycomponent') . '/templates',
      'template' =&gt; 'mycomponent_links_menu',
      'variables' =&gt; array(
        'config' =&gt; array(),
      ),
    ),
  );
}

/**
 * Implements hook_ctools_plugin_directory().
 */
function mycomponent_ctools_plugin_directory($owner, $plugin_type) {
  if ($owner === 'ctools' &amp;&amp; $plugin_type === 'content_types') {
    return 'plugins/content_types';
  }
}


Then, I needed to create an .inc file (mycomponent_links_menu.inc) to enable me to add the menu as a component. On that file I created the plugin, , eg:

$plugin = array(
  'single' =&gt; TRUE,
  'title' =&gt; t('Link Menu'),
  'description' =&gt; t('Displays links.'),
  'category' =&gt; t('Mycomponent'),
  'edit form' =&gt; 'mycomponent_link_menu_panel_settings',
  'render callback' =&gt; 'mycomponent_link_menu_panel_render',
  'defaults' =&gt; array(),
  'all contexts' =&gt; TRUE,
);


and rendered the panel to a block, grabbing each Field from the node's array:

function mycomponent_link_menu_panel_render($subtype, $conf, $args, $contexts) {
  $node_context = reset($contexts);
  $block = new stdClass();

  $field_text1_items = field_get_items('node', $node_context-&gt;data, 'field_text1');
  $field_text2_items = field_get_items('node', $node_context-&gt;data, 'field_text2');
  $field_text3_items = field_get_items('node', $node_context-&gt;data, 'field_text3')


  $panel_content = array(
    '#theme' =&gt; 'mycomponent_links_menu',
    '#config' =&gt; array(
      'link_to_something' =&gt; l(t('Something'), $field_text1_items [0]['safe_value']),
      'link_to_anotherthing =&gt; l(t('Anotherthing'), $field_text2_items [0]['safe_value']),
      'link_to_somthingelse' =&gt; l(t('Invision'), $field_text3_items [0]['safe_value']),
    ),
  );

  $block-&gt;content = render($panel_content);
  return $block;
}


Then I created a .tpl file that actually wrapped the rendered links in HTML, eg:

  &lt;li class="menu__item"&gt;
    &lt;?php print $config['link_to_somthingelse']; ?&gt;
  &lt;/li&gt;