Hi
may it could be a good idea to add a css class based on the workbench status the node have.
I know about a module (menu view unpublished) which set a class to a menu entry in the book menu for new drafts - so the menu entries can appear maybe in grey and italic

Comments

TDI007 created an issue.

snte’s picture

I think this would be useful. We did this for a project with a few lines in hook_preprocess_html.

We used this in Drupal 8:

  if ($node = \Drupal::request()->attributes->get('node')) {
    if ($node->moderation_state->target_id) { 
      $variables['attributes']['class'][] = 'state-' . $node->moderation_state->target_id; 
    }     
  }  

And this should work in Drupal 7. Not too sure if ist is also "$node->moderation_state->target_id", but you can have a look at the variables with devel:

  if ($node = menu_get_object()) {
    if ($node->moderation_state->target_id) {   
      $variables['classes_array'][] = drupal_html_class('state-' . $node->moderation_state->target_id);
    }
  }