About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:howtos:supporting_a_new_citation_style

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:howtos:supporting_a_new_citation_style [2023/03/27 19:03] – [Name the citation format] sturkeldevelopment:howtos:supporting_a_new_citation_style [2023/03/27 19:08] (current) demiankatz
Line 1: Line 1:
 ====== Supporting a New Citation Style ====== ====== Supporting a New Citation Style ======
  
-By default, VuFind supports MLA and APA citations. More can be added by following these steps:+By default, VuFind® supports MLA and APA citations. More can be added by following these steps:
  
 ====1. Name the citation format==== ====1. Name the citation format====
 Pick a name for your citation format. This must be a single word containing no special characters, so that the same value can be shared by configuration files, PHP method names, etc. The value used internally by **code/configuration** does not have to be the same as the text displayed to the end user (for example, we use "Chicago" as shorthand for "Chicago Style"). Pick a name for your citation format. This must be a single word containing no special characters, so that the same value can be shared by configuration files, PHP method names, etc. The value used internally by **code/configuration** does not have to be the same as the text displayed to the end user (for example, we use "Chicago" as shorthand for "Chicago Style").
  
-====Verify the record driver====+====2. Verify the record driver====
 Make sure the [[development:plugins:record_drivers|record drivers]] for records that can be cited in the new format return the name of the new citation format through their **getSupportedCitationFormats**() methods. Usually this can be accomplished by modifying [[https://github.com/vufind-org/vufind/blob/dev/module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php|VuFind\RecordDriver\DefaultRecord]], which is the base class for most other record drivers. Make sure the [[development:plugins:record_drivers|record drivers]] for records that can be cited in the new format return the name of the new citation format through their **getSupportedCitationFormats**() methods. Usually this can be accomplished by modifying [[https://github.com/vufind-org/vufind/blob/dev/module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php|VuFind\RecordDriver\DefaultRecord]], which is the base class for most other record drivers.
  
-====Configure the GetCitation Method====+====3. Configure the GetCitation Method====
 Make sure the [[https://github.com/vufind-org/vufind/blob/dev/module/VuFind/src/VuFind/View/Helper/Root/Citation.php|VuFind\View\Helper\Root\Citation]] view helper contains a getCitation* method for your new format. The existing **getCitationMLA** and **getCitationAPA** methods show how existing citations are generated by collecting information from the record driver and rendering a template. Make sure the [[https://github.com/vufind-org/vufind/blob/dev/module/VuFind/src/VuFind/View/Helper/Root/Citation.php|VuFind\View\Helper\Root\Citation]] view helper contains a getCitation* method for your new format. The existing **getCitationMLA** and **getCitationAPA** methods show how existing citations are generated by collecting information from the record driver and rendering a template.
  
-====Set up template(s)====+====4. Set up template(s)====
 Create necessary template(s) for the new citation format; existing templates can be found in the [[https://github.com/vufind-org/vufind/tree/dev/themes/root/templates/Citation|Citation folder of the root theme]]. Create necessary template(s) for the new citation format; existing templates can be found in the [[https://github.com/vufind-org/vufind/tree/dev/themes/root/templates/Citation|Citation folder of the root theme]].
  
-====Create a display label==== +====5. Create a display label==== 
-Modify the [[development:architecture:localization|language file(s)]] to include an appropriate display label for your citation format. VuFind will use the name of your format concatenated with the word "Citation" as a translation key. This is your opportunity to provide a more complete, human-readable version of the format name for display -- e.g. Chicago Citation = "Chicago Style Citation".+Modify the [[development:architecture:localization|language file(s)]] to include an appropriate display label for your citation format. VuFind® will use the name of your format concatenated with the word "Citation" as a translation key. This is your opportunity to provide a more complete, human-readable version of the format name for display -- e.g. Chicago Citation = "Chicago Style Citation".
  
 ---- struct data ---- ---- struct data ----
development/howtos/supporting_a_new_citation_style.1679943818.txt.gz · Last modified: 2023/03/27 19:03 by sturkel