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' => array(
'path' => drupal_get_path('module', 'mycomponent') . '/templates',
'template' => 'mycomponent_links_menu',
'variables' => array(
'config' => array(),
),
),
);
}
/**
* Implements hook_ctools_plugin_directory().
*/
function mycomponent_ctools_plugin_directory($owner, $plugin_type) {
if ($owner === 'ctools' && $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' => TRUE,
'title' => t('Link Menu'),
'description' => t('Displays links.'),
'category' => t('Mycomponent'),
'edit form' => 'mycomponent_link_menu_panel_settings',
'render callback' => 'mycomponent_link_menu_panel_render',
'defaults' => array(),
'all contexts' => 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->data, 'field_text1');
$field_text2_items = field_get_items('node', $node_context->data, 'field_text2');
$field_text3_items = field_get_items('node', $node_context->data, 'field_text3')
$panel_content = array(
'#theme' => 'mycomponent_links_menu',
'#config' => array(
'link_to_something' => l(t('Something'), $field_text1_items [0]['safe_value']),
'link_to_anotherthing => l(t('Anotherthing'), $field_text2_items [0]['safe_value']),
'link_to_somthingelse' => l(t('Invision'), $field_text3_items [0]['safe_value']),
),
);
$block->content = render($panel_content);
return $block;
}
Then I created a .tpl file that actually wrapped the rendered links in HTML, eg:
<li class="menu__item">
<?php print $config['link_to_somthingelse']; ?>
</li>