Hi,


I would like it very much if it was possible to apply different style (or styling) for differents documents types (ie. book, journal article, web article, etc.). I think the APA style give somes indications how to do this, but it is way out of my basic programming skills.

function biblio_style_apa($node, $base= 'biblio', $inline= false) {

  $contrib_array = _apa_format_authors($node->biblio_contributors);

  $authors = $contrib_array[1];

  $output .= '<span class="biblio-authors">'. $authors ."</span> \n";

  $output .= (strrpos($authors, '.') == strlen($authors)) ? ".&nbsp;&nbsp;" : " ";

  switch ($node->biblio_type) {

    case 1 : // Journal Article

    case 2 : //Conference Paper

    case 3 : // are all

    case 4 :

    case 5 :

    case 6 :

    case 7 :

    case 8 :

    case 9 :

    default :

      if (isset ($node->biblio_year)) {

        $output .= "(". check_plain($node->biblio_year) .").&nbsp;&nbsp;";

      }

      $output .= '<span class="biblio-title-apa">';

      $output .= $inline ? l("$node->title", "$base/viewinline/$node->nid") : l("$node->title", "node/$node->nid");

      $output .= ". </span> \n";

      $output .= !empty ($contrib_array[2]) ? '('. $contrib_array[2] .', Ed.).' : "";

      $output .= ($node->biblio_secondary_title) ? '<u>'. check_plain($node->biblio_secondary_title) .'. ' : '<u>';

      $output .= ($node->biblio_volume) ? check_plain($node->biblio_volume) . ($node->biblio_issue ? '</u>('. check_plain($node->biblio_issue) .'),&nbsp;' : ',</u> ') : '</u> ';

      //  $output .= ($node->biblio_issue) ? '('. check_plain($node->biblio_issue).')' :'';

      $output .= ($node->biblio_pages) ? check_plain($node->biblio_pages) .'.' : '';

      break; // generic

  }

  /*  if ($node->biblio_date) $output .= ', '. check_plain($node->biblio_date);

    if ($node->biblio_number) $output .= ', Number '. check_plain($node->biblio_number);



    if ($node->biblio_place_published) $output .= ', '. check_plain($node->biblio_place_published);

  */

  return $output;

}



Could someone post a complete exemple?


Thank you!


Denis B.

Comments

rjerome’s picture

Your right, the framework is there but it hasn't been implemented. Also note, if you are going to do this, the "case" values in the switch are wrong. Those numbers date back to the first version of biblio, the current types start at 100 and go to 130. Basically you would just copy the stuff from the default section to a specific case and modify it accordingly. I may get around to this someday, but I'm now off on vacation for a couple of weeks...

Ron.

p0732658’s picture

Thank you Ron for pointing me in right direction. Now that I know about the ''case'' values, I might be able to get it to work be myself. I will let you know...

Denis B.

p0732658’s picture

StatusFileSize
new3.71 KB
new8.46 KB

Hi Ron,

I don't know if Hell is going to freeze over, but I was able to do this by myself!!! Anyway, here is my results in case you think it could be usefult for others...

<?php
// $Id: biblio_style_custom.inc,v 0.0.0.1 2008/07/08 01:51:45 dboudreau Exp $
/**
 * Get the style information
 *
 * @return
 *   The name of the style
 */
function biblio_style_custom_info() {
  return array(
    'custom' => 'Custom style for biblio (Custom)'
  );
}
/**
 * Apply a bibliographic style to the node
 *
 *
 * @param $node
 *   An object containing the node data to render
 * @param $base
 *   The base URL of the biblio module (defaults to /biblio)
 * @param $inline
 *   A logical value indicating if this is being rendered within the
 *   Drupal framwork (false) or we are just passing back the html (true)
 * @return
 *   The styled biblio entry
 */
function biblio_style_custom($node, $base= 'biblio', $inline= false) {
  $contrib_array = _custom_format_authors($node->biblio_contributors);
  $authors = $contrib_array[1];
  $output .= '<span class="biblio-authors-custom">'. $authors ."</span> \n";
  $output .= (strrpos($authors, '.') == strlen($authors)) ? ".&nbsp;&nbsp;" : " ";
  switch ($node->biblio_type) {
    case 100 : // Book
      $output .= '<span class="biblio-title-custom"><i>';
      $output .= $inline ? l("$node->title", "$base/viewinline/$node->nid") : l("$node->title", "node/$node->nid");
      $output .= "</i></span>, \n";
	if ($node->biblio_place_published)
    	$output .= ''. check_plain($node->biblio_place_published) .":";
  	if ($node->biblio_publisher)
    	$output .= ' '. check_plain($node->biblio_publisher);
        if (isset ($node->biblio_year)) {
        $output .= ', ('. check_plain($node->biblio_year) .")\n";
  }
        if ($node->biblio_pages)
        $output .= ', '. check_plain($node->biblio_pages) .'&nbsp;';
	  if ($node->biblio_url) {
    	  $attrib = (variable_get('biblio_links_target_new_window', null)) ? array(
      	'target' => '_blank'
    	) : array();
    	  $output .= '<br /><small><span="biblio-url-label">'. t("Publisher info") .':</span>&nbsp;'. l($node->biblio_url, $node->biblio_url, $attrib) ."</small>\n";
  	}
        if ($node->biblio_access_date)
        $output .= "<small>&nbsp;[&nbsp;". check_plain($node->biblio_access_date) ."&nbsp;]&nbsp;</small>";
      break; // generic

    case 101 : // Book Chapter
    case 102 : // Journal Article
      $output .= '<span class="biblio-journal-title-custom">&laquo;&nbsp;';
      $output .= $inline ? l("$node->title", "$base/viewinline/$node->nid") : l("$node->title", "node/$node->nid");
      $output .= "&nbsp;&raquo;</span>, \n";
      $output .= !empty ($contrib_array[2]) ? '('. $contrib_array[2] .', Ed.).' : "";
        if ($node->biblio_secondary_title)
        $output .= 'in <span class="biblio-secondary-title-custom"><i>'. check_plain($node->biblio_secondary_title). "</i></span> \n";
        if ($node->biblio_volume)
        $output .= ', vol. '. check_plain($node->biblio_volume);
        if ($node->biblio_issue)
        $output .= ', n&#176; '. check_plain($node->biblio_issue);
        if ($node->biblio_number)
        $output .= ', Number '. check_plain($node->biblio_number);
      	if (isset ($node->biblio_year)) {
        $output .= "&nbsp;(&nbsp;". check_plain($node->biblio_date);
        $output .= '&nbsp;'. check_plain($node->biblio_year) ."&nbsp;)&nbsp;";
      }
        if ($node->biblio_pages)
        $output .= ', pp. '. check_plain($node->biblio_pages) .'&nbsp;';
	  if ($node->biblio_url) {
    	  $attrib = (variable_get('biblio_links_target_new_window', null)) ? array(
      	'target' => '_blank'
    	) : array();
    	  $output .= '<br /><small><span="biblio-url-label">'. t("Electronic version") .':</span>&nbsp;'. l($node->biblio_url, $node->biblio_url, $attrib) ."</small>\n";
  	}
        if ($node->biblio_access_date)
        $output .= "<small>&nbsp;[&nbsp;". check_plain($node->biblio_access_date) ."&nbsp;]&nbsp;</small>";
      break; // generic

    case 103 : // Conference Paper
    case 104 : // Conference Proceedings
    case 105 : // Newspaper Article
    case 106 : // Magazine Article
    case 107 : // Web Article
      $output .= '<span class="biblio-url-title-custom">&laquo;&nbsp;';
      $output .= $inline ? l("$node->title", "$base/viewinline/$node->nid") : l("$node->title", "node/$node->nid");
      $output .= "&nbsp;&raquo;</span>, \n";
    	$output .= ''. check_plain($node->biblio_place_published) .":";
  	if ($node->biblio_publisher)
    	$output .= ' '. check_plain($node->biblio_publisher);
        if (isset ($node->biblio_year)) {
        $output .= ', ('. check_plain($node->biblio_year) .")\n";
  }
	if ($node->biblio_url) {
    	$attrib = (variable_get('biblio_links_target_new_window', null)) ? array(
      	'target' => '_blank'
    	) : array();
    	$output .= '<span="biblio-url-label">'. t("online") .':</span>&nbsp;'. l($node->biblio_url, $node->biblio_url, $attrib) ."\n";
  	}
        if ($node->biblio_access_date)
        $output .= "&nbsp;[&nbsp;". check_plain($node->biblio_access_date) ."&nbsp;]&nbsp;";
      break; // generic


    case 108 : // Thesis
      $output .= '<span class="biblio-thesis-title-custom">&laquo;&nbsp;';
      $output .= $inline ? l("$node->title", "$base/viewinline/$node->nid") : l("$node->title", "node/$node->nid");
      $output .= "&nbsp;&raquo;</span>, \n";
      $output .= !empty ($contrib_array[2]) ? '('. $contrib_array[2] .', dir.).' : "";
        if ($node->biblio_secondary_title)
        $output .= ',&nbsp;<span class="biblio-academic-departement-custom">'. check_plain($node->biblio_secondary_title). "</span> \n";
        if ($node->biblio_volume)
        $output .= ',&nbsp;<span class="biblio-degree-custom">'. check_plain($node->biblio_volume). "</span> \n";
      	if (isset ($node->biblio_year)) {
        $output .= ",&nbsp;(&nbsp;". check_plain($node->biblio_date);
        $output .= '&nbsp;'. check_plain($node->biblio_year) ."&nbsp;)";
      }
        if ($node->biblio_pages)
        $output .= ', '. check_plain($node->biblio_pages) .'';
	if ($node->biblio_url) {
    	$attrib = (variable_get('biblio_links_target_new_window', null)) ? array(
      	'target' => '_blank'
    	) : array();
    	$output .= '<br /><small><span="biblio-url-label">'. t("Electronic version") .':</span>&nbsp;'. l($node->biblio_url, $node->biblio_url, $attrib) ."</small>\n";
  	}
        if ($node->biblio_access_date)
        $output .= "<small>&nbsp;[&nbsp;". check_plain($node->biblio_access_date) ."&nbsp;]&nbsp;</small>";
      break; // generic

    case 109 : // Report
    case 110 : // Film
    case 111 : // Broadcast
    case 112 : // Artwork
    case 113 : // Software
    case 114 : // Audiovisual
    case 121 : // Manuscript
    case 122 : // Map
    default :

      $output .= '<span class="biblio-title-custom"><i>';
      $output .= $inline ? l("$node->title", "$base/viewinline/$node->nid") : l("$node->title", "node/$node->nid");
      $output .= "</i></span>, \n";
	if ($node->biblio_place_published)
    	$output .= ''. check_plain($node->biblio_place_published) .":";
  	if ($node->biblio_publisher)
    	$output .= ' '. check_plain($node->biblio_publisher);
        if (isset ($node->biblio_year)) {
        $output .= ', ('. check_plain($node->biblio_year) .")\n";
  }
        if ($node->biblio_pages)
        $output .= ', '. check_plain($node->biblio_pages) .'&nbsp;';
        if ($node->biblio_url)
        $output .= "<br /><small>Online version:&nbsp;". check_plain($node->biblio_url) .'&nbsp;&nbsp;</small>';
        if ($node->biblio_access_date)
        $output .= "<small>&nbsp;[&nbsp;". check_plain($node->biblio_access_date) ."&nbsp;]&nbsp;</small>";
      break; // generic
  }
  return $output;
}
function _custom_format_authors($contributors) {
  if (count($contributors)) {
    foreach ($contributors as $key => $author) {
      $format= $author['prefix'] .' '. $author['lastname'].',';
      $format .= !empty ($author['firstname']) ? ' '. drupal_substr($author['firstname'], 0, 1) .'.' : '';
      $format .= !empty ($author['initials']) ? $author['initials'] .'.' : '';
      if (variable_get('biblio_author_links', 1)) {
        $base= variable_get('biblio_base', 'biblio');
        $format= _biblio_author_link($format, $author['cid'], $base, $inline);
      }
      $author_array[$author['type']] .= (!empty ($author_array[$author['type']])) ? ', '. $format : $format;
    }
  }
  if (count($author_array)) {
    return $author_array;
  }
  else {
    return array(
      1 => t('No author information available')
     );
  }
}

I've also attache my files (1) biblio_style_custom.inc : change the .txt for .inc and 2) biblio_custom.css : change "_css.txt" to ".css".

Hope this will be usefull to someone

ntripcevich’s picture

Good work Denis! This is a nice template to start from for others.
Ron mentioned elsewhere that (in the long term) he's looking to move it to a system where we can link into Zotero styles somehow, but this is a great step and various groups can share their specialized biblio styles.

I quickly tried to implement what you've done and I'm getting "No author information available" in the author slots, and also a space around the year ( 2008 ).
I tried to solve these issues and without spending much time at it wasn't able to decode the problem. Maybe you resolved it in a newer version?
Thanks!

p0732658’s picture

Thank you ntripcevich!

I am very glade you find this helpful... I'm not a very good coder, so I did lost a couple of hairs doing this!!!
I don't know about "No author information available". What document type is it from ? As for the space problems, look for the code &nbsp;. For exemple :

      if (isset ($node->biblio_year)) {
        $output .= "&nbsp;(&nbsp;". check_plain($node->biblio_date);
        $output .= '&nbsp;'. check_plain($node->biblio_year) ."&nbsp;)&nbsp;";

To take out space inside the backets, you would have to remove the &nbsp after the "(" and before ")".

I put space their because I write my bibiographies in french. Howerver, the next time I post something I will try to make more "universal".

Denis

jenifertucker’s picture

Title: Differents styles for differents documents types » Biblio customized style - white screen
Version: 6.x-1.0-beta8 » 6.x-1.4

Hi there

I was looking to customize a style and came across your biblio_stye_custom.css and biblio_custom.css files. I copied them into my biblio folder and then went to Administer > Biblio settings > Styling where I selected "Custom style for biblio (Custom)".

I then took a look at the list of citations and I just got a blank white screen.

Is there something else I need to do than just copy these two files into the directory?

Many thanks.
Jenifer

rjerome’s picture

Hi Jenifer,

I'm not surprised, things have changed greatly since that style was written, hence that style won't work with the current release.

If you want to write your own style (simple), you could start with biblio_style_cse.inc, copy it to something like biblio_style_jt.inc, then edit biblio_style_jt.inc and change ALL instances of "cse" to "jt" (including and most importantly the function names). You should end up with something like the code below...

Basically your just dumping various fields in a particular order with the appropriate punctuation between them. The check_plains are important for security reasons.

This is quite a simple example, if you want to get really fancy, you could modify something like MLA, but I wouldn't recommend starting with that one.


/**
 * Get the style information
 *
 * @return
 *   The name of the style
 */
function biblio_style_jt_info() {
  return array (
    'jt' => 'Jenifer Tucker Style (JTS)'
  );
}
/**
 * Apply a bibliographic style to the node
 *
 */
function biblio_style_jt_author_options() {
  $author_options = array(
    'BetweenAuthorsDelimStandard'     =>', ',      //4
    'BetweenAuthorsDelimLastAuthor'   => ', ', //5
    'AuthorsInitialsDelimFirstAuthor' => ', ',     //7
    'AuthorsInitialsDelimStandard'    => ' ',      //8
    'betweenInitialsDelim'            => '',     //9
    'initialsBeforeAuthorFirstAuthor' => false,    //10
    'initialsBeforeAuthorStandard'    => FALSE,     //11
    'shortenGivenNames'               => TRUE,    //12
    'numberOfAuthorsTriggeringEtAl'   => 10,       //13
    'includeNumberOfAuthors'          => 10,       //14
    'customStringAfterFirstAuthors'   => ' et al.',//15
    'encodeHTML'                      => true
  );
  return $author_options;
}

function biblio_style_jt($node, $base = 'biblio', $inline = false) {
  $author_options = biblio_style_jt_author_options();
  $authors = theme('biblio_format_authors', $node->biblio_contributors[1], $author_options, $inline);
  if (empty($authors) && count($node->biblio_contributors[5])) {// if no authors substitute corp author if available
    foreach ($node->biblio_contributors[5] as $rank => $author) {
      $authors .= (empty($authors)) ? '' : ', ';
      $authors .= (variable_get('biblio_author_links', 1)) ?  theme('biblio_author_link',$author['name'], $author['cid'], variable_get('biblio_base', 'biblio'), $inline) : $author['name'];
    }
  }
  if (empty($authors)) $authors = '[' . t('Anonymous') . ']';  // use anonymous if we still have nothing.
  if (!empty ($node->biblio_citekey)&&(variable_get('biblio_display_citation_key',0))) {
    $output .= '[' . check_plain($node->biblio_citekey) . '] ';
  }
// first output the authors
  $output .= '<span class="biblio-authors">' . $authors . "</span>.&nbsp; \n";
  switch ($node->biblio_type) {

    default :
// year 
     if (isset ($node->biblio_year)) {
        $output .= check_plain($node->biblio_year) . ".&nbsp;&nbsp;";
      }
 // title of the article
      $output .= '<span class="biblio-title">';
        $link = ((variable_get('biblio_link_title_url', 0) && !empty($node->biblio_url)) ? $node->biblio_url : ($inline ? "$base/viewinline/$node->nid":"node/$node->nid" ) ) ;
        $options['attributes'] = (variable_get('biblio_links_target_new_window',null) && variable_get('biblio_link_title_url', 0) && !empty($node->biblio_url)) ? array('target'=>'_blank') : null;
        $output .= l($node->title, $link, $options);
      $output .= (strpos($node->title, '?'))? " </span>" : ". </span>";  // if the title ends in a question mark, don't put a period after it.
 
// title of publication
      $output .= (!empty ($node->biblio_secondary_title)) ? check_plain($node->biblio_secondary_title) . '. ' : '';
// volume
      $output .= (!empty ($node->biblio_volume))          ? check_plain($node->biblio_volume) : '';
// issue
      $output .= (!empty ($node->biblio_issue))           ? '(' . check_plain($node->biblio_issue) . ')' : '';
// pages
      $output .= (!empty ($node->biblio_pages))           ? ':' . str_replace(" ", "", check_plain($node->biblio_pages)) . '.' : '';
      break; // generic
  }
  /*  if ($node->biblio_date) $output .= ', '. check_plain($node->biblio_date);
    if ($node->biblio_number) $output .= ', Number '. check_plain($node->biblio_number);

    if ($node->biblio_place_published) $output .= ', '. check_plain($node->biblio_place_published);
  */
  return $output;
}
jenifertucker’s picture

Thanks - I had noticed it was quite old, so appreciate your helpful advice.

I copied the 'Chicago' style as it was closer to the format layout I am wanting to achieve inside the biblio directory and replaced all instances as you suggested.

I then tried to go back to the admin pages to select this new style, but got a white screen when I clicked on Administer > Site configuration > Biblio settings.

I also tried to run update.php, but still see the white screen when I try to go to the Biblio settings page.

Just looked at the logs and I've got a server error

[30/May/2009:10:33:39 +0100] "GET /admin/settings/biblio HTTP/1.1" 500 -

I only know the very basics of this side of things, so don't know what has caused this problem when I copied an existing file, renaming it and matching all function name changes, etc.

Jenifer

rjerome’s picture

The cause of "White Screen" errors are not likely to show up in the web server logs as they are usually PHP related. If it isn't already enabled, you would need to turn on PHP error logging in the php.ini file and then check the php error logs which I'm sure will lead you to the root of the problem.

Ron.

jenifertucker’s picture

Why would a simple copy of an existing .inc file called biblio_style_chicago.inc to biblio_style_jlt.inc with all instances of 'chicago' to 'jlt' cause such a thing? You comment made it sound that's all you needed to do and didn't hint at any side affects.

As I said, I don't have much experience with the server side of things. I'm not sure where the PHP error logs are.

rjerome’s picture

My guess is that either there is a syntactical error in the modified file causing PHP to crash OR a memory issue. On more than one occasion I have seen out of memory errors causing this sort of problem. A default PHP/Drupal installation seems to be teetering on the edge of the default PHP memory limit and adding a few more modules or code can sometimes push it over the edge. Enabling the PHP error logs will almost always tell you where the problem lies. Without this information, you (an I) are really just shooting in the dark.

It really isn't hard to turn on error logging (assuming you have administrative access to the server). Just edit the php.ini file and look for the error logging section as follows. This is off my development machine, so I have errors displayed on screen (display_errors = On), you don't want on a production site, but you get immediate feedback and don't have to dig through the logs.

If you make any changes to the php.ini file, you will have to restart your web server for them to take effect.

BTW, what platform are you running on? (Windows, Linux, ...)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
; E_ALL             - All errors and warnings (doesn't include E_STRICT)
; E_ERROR           - fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_STRICT          - run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
;
; Examples:
;
;   - Show all errors, except for notices and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
;
;   - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - Show all errors, except coding standards warnings
;
error_reporting  =  E_ALL

; Print out errors (as a part of the output).  For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below).  Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On

; Even when display_errors is on, errors that occur during PHP's startup
; sequence are not displayed.  It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = Off

; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = On

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same
; line until ignore_repeated_source is set true.
ignore_repeated_errors = Off

; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; sourcelines.
ignore_repeated_source = Off

; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
report_memleaks = On

; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off

; Disable the inclusion of HTML tags in error messages.
; Note: Never use this feature for production boxes.
;html_errors = Off

; If html_errors is set On PHP produces clickable error messages that direct
; to a page describing the error or function causing the error in detail.
; You can download a copy of the PHP manual from http://www.php.net/docs.php
; and change docref_root to the base URL of your local copy including the
; leading '/'. You must also specify the file extension being used including
; the dot.
; Note: Never use this feature for production boxes.
;docref_root = "/phpmanual/"
;docref_ext = .html

; String to output before an error message.
;error_prepend_string = "<font color=ff0000>"

; String to output after an error message.
;error_append_string = "</font>"

; Log errors to specified file.
;error_log = filename

; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
jenifertucker’s picture

Thanks for the insight. I'll go and see what I can find.
The rest of the website is running perfectly, the exception just being the biblio settings.

This is what I've got....

MySQL database 5.0.77
PHP 5.2.6
PHP memory limit 32M
Web server Apache/2.2.9 (Fedora)

rjerome’s picture

That should be plenty of memory, so it's most likely a syntactical error.

Did you remove the file containing your first attempt at this (based on Comment #3)?

Also note that the file name and function names must match (including case) so if you called the file biblio_sytle_jt.inc then you would have 3 functions called:

  • biblio_style_jt_info()
  • biblio_style_jt_author_options()
  • and biblio_style_jt()

the "jt" part being common and the same case.

The code is scanning the directory the module is in for files name biblo_style_*.inc and then trying to call the biblio_style_*_info() function in each one. It's building the name of the "info" function based on the file names found, thus they must match or a undefined function error will occur.

jenifertucker’s picture

Thanks for all your help rjerome. It's all working now after your reminder about removing the first attempt ... something so stupid to have done was to leave the biblio_custom css file there :-/
My apologies for overlooking this, but thanks for replying in the first place.

Am I right that if the biblio module is updated, I'll lose my custom style so need to keep it somewhere safe?

rjerome’s picture

Glad to hear it working now, as long as it doesn't have the same name as one of the supplied styles, then it will not get overwritten when you upgrade biblio. Now it the interface to the module happens to change then it may stop working, but that's not likely to happen any time soon.

Cheers,

Ron.

rjerome’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.