I am rather stumped, been searching for hours but simply cannot find this setting. What I would like to do is change the secondary author label for certain publication types to editor. I saw a previous post http://drupal.org/node/1084386 where it says:

You can change the label of that field for any given publication type by going to the "admin/settings/biblio/fields/type" page and clicking on "edit" for the type in question.

But how do I access those settings= in version 7 of the module?

Best,
Gerben

CommentFileSizeAuthor
#3 biblio-screenshot.png25.64 KBhartcapl

Comments

boabjohn’s picture

Title: where to change author labels for each publication type » Where to change author labels for each publication type
Version: 7.x-1.0-rc4 » 7.x-1.0-rc7

Same here...I am trying to publish a type = Report, and my secondary authors are shown as "Series Editors".

Going to: ../admin/config/content/biblio/fields
and choosing type = Report, there does not appear to be any provision for setting the label for Authors (primary or secondary).

Thoughts?

boabjohn’s picture

Seems like this one should be a simple case of RTFM or look again at the obvious interface option...but I'm still adrift...showing Series Editor is really not good for my Report citation...I need Secondary Authors.
JB

hartcapl’s picture

Category: support » bug
StatusFileSize
new25.64 KB

I too am having this issue. I have users on our site who have edited a book, but the citation shows them as authors both in the listing, i.e. ..../ca/biblio and also when you click on the citation and are given the full tabular citation. however, if you then edit the citation, it shows that the "authors" are "primary" and "editors".

in the help text at the top of ...admin/config/content/biblio/fields, it reads:

"Finally, for each author field you can choose a set of author roles. Assigning different roles to authors within the same field, e.g. primary and secondary authors within the authors field, allows to theme them differently."

however, i can't find an "author field".

richlivi’s picture

Issue summary: View changes

I'm experiencing the same problem (i.e., I'd like to change secondary author label to "Editors"). It's been several years since this issue was opened, does anyone have any suggestions?

rupesh_jagtap’s picture

Hi,

@richlivi can you please share more details about your issue. I can only see 'secondary author' option in roles dropdown under 'authors' tab in 'fields' section.

May be I can help you out to resolve the problem.

stephaniemoore’s picture

I second this issue. On the "Fields" admin page, I don't have an "Authors" tab at all.

brewerkr’s picture

I third the issue. There is no Authors tab and if you select a Category of "Secondary Author" on a "Conference Paper", it puts those secondary authors in a line with the incorrect label of "Editor".

I found in https://www.drupal.org/node/2305823 - "- It seems only the contributor category has an effect on the displayed values based on the field configuration for that publication type (in misc/biblio.field.type.data.csv)". When you look in the CSV I can see the incorrect label that I want to fix. I've tried updating it (under Conference Paper, making the secondary author say "Secondary Author") saving and flushing all caches, but the change doesn't take. Any ideas how to get it to go through?

thememorious’s picture

@brewerkr I am having the same problem. Did you ever find a solution? I can't seem to make Biblio re-read the edited csv file.

alan d.’s picture

I couldn't see any code that done this and had to implement my own solution. It is a bit advanced, but in case anyone finds it useful.

Note there is no context to biblio_type from just using the theming function...

1) Add a form alter and append an after_build to the form.

An after build is required as D7 form has some fik'ed caching logic... long story for another day.

function MODULE_form_node_form_alter(&$form, &$form_state) {
  $node = $form['#node'];
  if ($node->type == 'biblio') {
    $form['#after_build'][] = 'MODULE_form_node_form_alter_biblio_after_build';
  }
}

2) Implement the after build

Restricts the available roles for Journal Articles

Hides the category (confused many)

function MODULE_form_node_form_alter_biblio_after_build($form, &$form_state) {
  if (!empty($form['biblio_tabs']['biblio_authors']['biblio_contributors'])) {

    // I'm working via a module, you could just do a custom THEME_biblio_contributors().
    $form['biblio_tabs']['biblio_authors']['biblio_contributors']['#theme'] = 'MODULE_biblio_contributors';

    // Override labels and available roles.
    $options_override = array();
    if (!empty($form_state['values']['biblio_type'])) {
      switch ($form_state['values']['biblio_type']) {
        case '102': // Journal
          $options_override = array(
            1 => t('Author'),
            14 => t('Editor'),
            13 => t('Translator'),
          );
          break;

      }
    }

    // Check that all options exist from any import, otherwise these default to author.
    // Note, I'm also skipping Secondary Author (2)....Corporate Author (5)
    if ($options_override) {
      foreach (element_children($form['biblio_tabs']['biblio_authors']['biblio_contributors']) as $key) {
        if (!empty($form['biblio_tabs']['biblio_authors']['biblio_contributors'][$key]['auth_type']['#default_value'])) {
          $value = $form['biblio_tabs']['biblio_authors']['biblio_contributors'][$key]['auth_type']['#default_value'];
          if ($value > 5 && empty($options_override[$value])) {
            $options_override[$value] = $form['biblio_tabs']['biblio_authors']['biblio_contributors'][$key]['auth_type']['#options'][$value];
          }
        }
      }
    }

    foreach (element_children($form['biblio_tabs']['biblio_authors']['biblio_contributors']) as $key) {
      // Forces category to 1 and hides this field.
      $form['biblio_tabs']['biblio_authors']['biblio_contributors'][$key]['auth_category'] = array(
        '#type' => 'value',
        '#value' => 1,
      );
      // Apply the overrides if applicable.
      if ($options_override) {
        $form['biblio_tabs']['biblio_authors']['biblio_contributors'][$key]['auth_type']['#options'] = $options_override;
      }
    }
  }
  return $form;
}

3) Re-theme the form

In my case, I removed the t('Category) header and appended this value form field to type.

The hook_theme() is because I'm changing the theming function in the afterbuild to ensure this works no matter what theme is active.


/**
 * Implements hook_theme().
 */
function MODULE_theme($existing, $type, $theme, $path) {
  return array(
    'MODULE_biblio_contributors' => array(
      'render element' => 'form',
    ),
  );
}

function theme_MODULE_biblio_contributors($variables) {
  // Clones theme_biblio_contributors() with these changes.
  $headers = array('', t('Name'), t('Role'), t('Weight'));
  $row[] = array('data' => drupal_render($form[$key]['auth_category']) . drupal_render($form[$key]['auth_type']),
                     'class' => array('biblio-contributor-type'));
}