Skip to content

Docs

TIP

Prefer the table-based configuration for managing search form fields.
It centralizes settings and uses the same underlying functions as manual methods.

⚠️ The table-based method may not cover all cases. For advanced customizations, override with dedicated functions as needed.

docs table

Document titles (getDocumentSummary)

The title rows use the specialFields property from the .blf.yaml file to automatically show the document title, author, and date. But you can also customize this using a custom function.
--> BlackLab docs

js
/**
 * @param metadata all metadata of the document, in the form of { [fieldName: string]: string[] }
 * @param specialFields the names of the pid, title, author, and date fields, in the shape of 
  { 
    authorField: string, 
    pidField: string, 
    dateField: string, 
    titleField: string 
  }
  @returns {string}
*/
vuexModules.ui.getState().results.shared.getDocumentSummary = function(metadata, specialFields) {
  return 'Title: ' + (metadata[specialFields.titleField]?.[0] || 'Unknown');
};

Columns (shownMetadataIds)

To Change the columns shown in the results table, you can use the shownMetadataIds property. This is an array of metadata field names that you want to display as columns in the results table.

js
vuexModules.ui.actions.results.docs.shownMetadatIds(['date'])

Apache license 2.0