Hi,

firstofall thank you for that really really great module!
It's mega useful and a big big helper, thank you for that!

Furthermore I have an idea that could help to furthermore improve the module in usability.

Currently all export actions are separate tabs in Drupal 7. This is really bad for usability, because tabs start to become double-lined or even more on many sites. I think there is a good solution for this in Drupal 7, because we have "Secondary Tabs" available as Sub-Tasks of Tabs. (For example look at Profiles > Edit!)

All Export functionalities could be handled in one parent-tab this way and UI would be improved heavily. I think we should use this D7 feature to still become a step better.

What do you think about this?
Eventually that could be integrated as option in settings or (I prefer that) generally.

Current display:

Improved display:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thomas.frobieter’s picture

I completely agree, this would be great.

Anybody’s picture

We currently use this code as workaround in template.php:
(But this is not a real good solution for future)

function MYTHEME_preprocess_page(&$vars) {
  if(!empty($vars['primary_local_tasks'])){
    $tab_parent_href = null;
    $keep_as_parent = FALSE;
    $active = FALSE;
    $secondary_local_tasks_prepared = array();
    foreach($vars['primary_local_tasks'] as $key => $primary_local_task){
      if(strpos($primary_local_task['#link']['path'], 'node/%/node_export/') !== FALSE){
        // This is an export tab.
        if($tab_parent_href === null){
          // Create parent task from first found element. Copy and convert it.
          $vars['primary_local_tasks'][$key]['#link']['title'] = t('Node Export');
          $tab_parent = $primary_local_task['#link']['path'];
          $tab_parent_href = $primary_local_task['#link']['tab_parent_href'] . '/node_export/json';
          $keep_as_parent = TRUE;
        } else {
          // We don't need the rest as parent!
          $keep_as_parent = FALSE;
        }
        // Only show if an export item is #active
        if($primary_local_task['#active']){
          $active = TRUE;
        }

        // Create subtask from this item.
        $secondary_local_task = $primary_local_task;
        unset($secondary_local_task['#active']);
        $secondary_local_task['#link']['tab_parent'] = $tab_parent;
        $secondary_local_task['#link']['tab_parent_href'] = $tab_parent_href;
        $secondary_local_tasks_prepared[] = $secondary_local_task;
        if(!$keep_as_parent){
          // Delete this tab. It's no parent!
          unset($vars['primary_local_tasks'][$key]);
        }
      }
    }
    if($active && !empty($secondary_local_tasks_prepared)){
      // Display subtasks! We're on a subpage of export.
      if(empty($vars['secondary_local_tasks'])){
        $vars['secondary_local_tasks'] = array();
      }
      $vars['secondary_local_tasks'] = array_merge($vars['secondary_local_tasks'], $secondary_local_tasks_prepared);
    }
  }
}
danielb’s picture

Issue summary: View changes

It's a great idea, but there are some reasons this has been neglected in the past
- Typically you would only enable one of the Node export formats, and therefore only have one tab. Maybe two for some reason - but who needs them all?
- It is not a module that you usually keep enabled on your site for long periods of time.

Certainly if this has to be redesigned, then I'd do it differently.

danielb’s picture

Status: Active » Postponed