Creating a reference style template with optional data fields

Whenever a reference style template is created, all fields are treated as mandatory. To make data fields optional, the field needs to be encased with special markers. 

  • {#MetaData} - the hash sign signals that a lookup is required to determine if there is any data present in the nominated data field. If YES, then display the template that follows, if not, ignore the template that follows
  • {^MetaData} - the inverted arrowhead signals that a lookup is required to determine if there is any data present in the nominated data field. If NO, then display the template that follows, if YES, ignore the template that follows
  • {/MetaData} - this signifies the end of the conditional data field lookup procedure, and template

 

Example 1: In this example, the Journal Issue is optional and all the other data fields are mandatory.

{Author} ({YearPublished}). {ArticleTitle}. {JournalTitle}, {Volume}{#Issue}({Issue}){/Issue}, pp. {PageFrom}-{PageTo}{Source}

  • Example 1 is saying, if there is data in the 'Issue' data field, add (n) to the template, otherwise ignore it.

 

Example 2: In this example, we want to list the doi if one exists, otherwise we will list the database name and associated identifier.

{#DatabaseIdentifier} doi:{DatabaseIdentifier}{/DatabaseIdentifier}{^DatabaseIdentifier} {Database}: {DatabaseIdentifier2}{/DatabaseIdentifier}

  • Example two is saying, if there is data in the DatabaseIdentifier data field, then write 'doi:1234' as the output, if there is no data in the DatabaseIdentfier then provide 'Proquest: 5678' as the output (where Proquest is the Database name).
Have more questions? Submit a request

Comments