Hi!

I would like the possiblity to display authors in different bibliographic style according to their type. For instance, I would like to include theses Advisor [set in Secondary author] between (NAME, Surname and Surname NAME) in list. In some case, I would also like to display Illustrators [set in Tertiary author], Corporate authors, etc., in some list. How could I acheive this.

Thank you

Denis B.

Comments

p0732658’s picture

I think my previous post is not very clear. I guest my english is not that good today! Here is an example of what I would like to display in a bibliographic list with the help of a custom style based on one of the style provided with biblio:

At the moment my style display this:

Benahmed, Yacine. "Dialogue humain-machine sur les dispositifs mobiles.", (Thèse de M.Sc.A.: Génie électrique), Département de génie électrique, Faculté d'ingénierie.: Université de Moncton, Moncton, N.-B. 2009. xi, 81 f.

I would like to display this instead:

Benahmed, Yacine. "Dialogue humain-machine sur les dispositifs mobiles.", (Thèse de M.Sc.A.: Génie électrique), Département de génie électrique, Faculté d'ingénierie.: Université de Moncton, Moncton, N.-B. 2009. xi, 81 f. [ Sous la direction de Selouan, Sid-Ahmed, and Hamam Habib ]

"Selouan, Sid-Ahmed, and Hamam Habib" are inputed with biblio_secondary_authors. How could I have secondary authors printed at the end of my citation in lists?

My code:

case 108: //Theses
	      if(!empty($authors)) {
        $output .= '<span class="biblio-authors">';
        $output .= $authors;
        if (!preg_match("/\. *$/", $authors)) $output .= ".";
        $output .= '</span>';
      }
        if (!empty($node->title))      // title
        {
          if (!empty($authors))  $output .= " ";

          //$output .= '"<i>' ;
          $output .= '"<span class="biblio-title-bva">';
          $url = biblio_get_title_url_info($node, $base, $inline);
          $output .= l($node->title, $url['link'], $url['options']);
          $output .= "</span>";
         // $output .= '</i>';
          if (!preg_match("/[?!.]$/", $node->title)) $output .= ".";
          $output .= '"';
        }

        if (!empty($node->biblio_contributors[2]))      // editor
        {
          $editor_options = array(
            'BetweenAuthorsDelimStandard' =>', ',         //4
            'BetweenAuthorsDelimLastAuthor' => ', and ',  //5
            'AuthorsInitialsDelimFirstAuthor' => ' ',     //7
            'AuthorsInitialsDelimStandard'=> ' ',         //8
            'betweenInitialsDelim' => '. ',               //9
            'initialsBeforeAuthorFirstAuthor' => true,   //10
            'initialsBeforeAuthorStandard' => true,       //11
            'shortenGivenNames' => false,                 //12
            'numberOfAuthorsTriggeringEtAl' => 3,         //13
            'includeNumberOfAuthors' => 1,                //14
            'customStringAfterFirstAuthors' => ', et al.',//15
            'encodeHTML' => true
          );
          $editor = theme('biblio_format_authors', $node->biblio_contributors[2], $editor_options, $inline);
          _period_when_needed($output);

          if (count($node->biblio_contributors[2]) > 1) { // there are at least two editors (separated by ';')
            $output .= " Sous la direction de" . $editor;
          }
          else { // there's only one editor (or the editor field is malformed with multiple editors but missing ';' separator[s])
            $output .= " " . $editor;
          }
        }
		 if (!empty($node->biblio_label)) {
           $output .= ", (" . $node->biblio_label." de ";    // Genre
          }
        if (!empty($node->biblio_volume)) 
        {
          $output .= " " . $node->biblio_volume; // Degree
        }
		 if (!empty($node->biblio_type_of_work)) {
           $output .= ":  " . $node->biblio_type_of_work."), ";    // Domaine
          }
		
		$publication = preg_replace("/[ \r\n]*\(Eds?:[^\)\r\n]*\)/", "", $node->biblio_secondary_title);   // Academic Department and Faculty
        if (!empty($publication))      // publication
        $output .= "$publication";

        _period_when_needed($output);
        if (!empty($node->biblio_publisher))      // University or School
        {
          if (!empty($node->biblio_place_published))  $output .= ":";
          $output .= " " . $node->biblio_publisher. ", " ;  // University or School
        }
        if (!empty($node->biblio_place_published)) {     // City
          $output .= " " . $node->biblio_place_published;
        }
        if (!empty($node->biblio_year))      // year
        {
          $output .= " " . $node->biblio_year .". ";
        }
        _period_when_needed($output);
        if (!empty($node->biblio_pages)) {     // pages
          $output .= theme_biblio_page_number($node->biblio_pages);
        }
        _period_when_needed($output);
        //if (!preg_match("/\. *$/", $output))  $output .= ".";

      break;

Thank you,

Denis B

rjerome’s picture

Seconday authors are stored in $node->biblio_contributors[2] so in theory, I would have expected them to show up somewhere in your output as per this block of code...

        if (!empty($node->biblio_contributors[2]))      // editor
        {
          $editor_options = array(
            'BetweenAuthorsDelimStandard' =>', ',         //4
            'BetweenAuthorsDelimLastAuthor' => ', and ',  //5
            'AuthorsInitialsDelimFirstAuthor' => ' ',     //7
            'AuthorsInitialsDelimStandard'=> ' ',         //8
            'betweenInitialsDelim' => '. ',               //9
            'initialsBeforeAuthorFirstAuthor' => true,   //10
            'initialsBeforeAuthorStandard' => true,       //11
            'shortenGivenNames' => false,                 //12
            'numberOfAuthorsTriggeringEtAl' => 3,         //13
            'includeNumberOfAuthors' => 1,                //14
            'customStringAfterFirstAuthors' => ', et al.',//15
            'encodeHTML' => true
          );
          $editor = theme('biblio_format_authors', $node->biblio_contributors[2], $editor_options, $inline);
          _period_when_needed($output);

          if (count($node->biblio_contributors[2]) > 1) { // there are at least two editors (separated by ';')
            $output .= " Sous la direction de" . $editor;
          }
          else { // there's only one editor (or the editor field is malformed with multiple editors but missing ';' separator[s])
            $output .= " " . $editor;
          }
        }

Are you sure they are stored as secondary authors? You say they were input with " biblio_secondary_authors" but that field doesn't exist anymore....

p0732658’s picture

Hi Ron,

In admin/settings/biblio/fields/type/edit/108, I have set Thesis Advisor to biblio_secondary_authors and Secondary Author in the selection menu. The information now print correctly were it should. I think it didn't work at first because "biblio_secondary_authors" was set at "Tertiary Author".

I'm still confuse, do I have to include :

if (!empty($node->biblio_contributors[2]))      // editor
[...]
[...]
[...]
           $output .= " " . $editor;
          }
        }

Everytime I want to include an author/contributor in my custom style? How to I determine the number in biblio_contributors[2]? Is it the same one specify in Type ID at admin/settings/biblio/author/type?

For exemple, if I wanted to display translators, would I use biblio_contributors[13]? An what about $output .= " " . $editor;, would that line remained the same?

Thank you!

Denis

rjerome’s picture

There are basically 5 categories of authors... Primary, Secondary, Tertiary, Subsidiary and Corporate, which correspond to

biblio_contributors[1]
biblio_contributors[2]
biblio_contributors[3]
biblio_contributors[4]
biblio_contributors[5]

There are a couple of things to note before you delve too deeply into changing the styling code...

  1. I'm seriously considering doing away with this current data structure because it's kind of clumsy (although the actual categories will remain).
  2. Future releases are going to contain a completely new and different styling mechanism based upon the CSL . You may notice in the 6.x-2.x and 7.x branches a new module called CiteProc, this is the beast that is doing the styling. The advantage of CSL is that it abstracts the styling from the data in an XML file (csl files are XML files), the creating new styles are modifying existing ones is just a mater of a few changes to the XML file, and there will soon be a WYSIWYG editor for CSL style files which will make it really easy.
liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.