Developer notes

This page presents some developer notes if you want to customize BibORB to your needs.

Add new fields

It is possible to customize BibORB by adding new fields. This can be realize in two steps. Let's assume you want to add an ISBN field for the BibTeX entry "book":
  • Add isbn to the $bibtex_entries variable in the config.php file.
        $bibtex_entries = array(
        "id",
        ...
        "link",
        "isbn" // <-- add the "isbn" value
    );
  • Add the XML field tag <isbn/> to the book entry in xsl/model.xml. For this example, I want it to be an optional field:
                ...
    <entry type="book">
        <required>
          <id/>
          <exalternative>
            <author/><editor/>
          </exalternative>
          <title/><publisher/><year/>
          <!-- place here if isbn is a required field -- >
        </required>
        <optional>
          <exalternative>
            <volume/><number/>
          </exalternative>
          <series/><address/><edition/><month/><note/>
          <!-- place here if isbn is an optional field -- >
          <isbn/> 
        </optional>
        <additional>
          <groups/><abstract/><keywords/>
          <url/><urlzip/><pdf/><website/><link/><longnotes/>
          <!-- place here if isbn is an additional field -- >
        </additional>
      </entry>
      ...
  • That's all! Go back to BibORB, add a new book reference: an 'isbn' field is then present in the optional section.

Create new types of references

BibORB was originally designed to handle BibTeX bibliographies. However, if BibTeX types, fields are not sufficient, or simply don't suit your bibliographic data (musique, video, ....), you can define your own types of references.

BibORB uses the xsl/model.xml to determine which types are available and which fields they contain. By adding the following code to xsl/model.xml you will create a new type named friend containing three required fields (fullname, birthDate, address) and one optional field (phoneNumber). The only requirement is to add a tag <id/> that uniquely identifies the new bibliographic item.

<entry type='friend'>
    <required>
        <id/>
        <fullName/>
        <birthDate/>
        <addresss/>
    </required>
    <optional>
        <phoneNumer/>
    </optional>
</entry>