In preparing a bibtex export of publications for the 40th LTER anniversity review the export needs to include in the keywords - LTER-XXX, where XXX= three-letter site acronym.
UPDATE #2:
So now we are not adding the ltersite field but we will need to add LTER-XXX as a keyword. So a simple wayis to:
$kw_array = array();
$kw_array[] = 'LTER-'.token_replace('[site:station-acronym]');
Note this will add it to a bibtex export only.
Another refinement:
citekey is use for the bibtex export as the id. In the biblo settings it is set to node ID. It can be changed to another field but the change will on be for new or updated entries. One trick is to use VBO to update all the biblio nodes by selecting change value, status and then next without changing the status and all the nodes will be updated but with no changes other then the new citekey will be generated.
UPDATE: After searching and looking at the biblio module I found 2 3 ways to accumblish this. And I would guess that below is the best way.
1. An even simpler way to add ltersite and a fix to the export of thesis
$bibtex .= _biblio_bibtex_format_entry('ltersite', 'NSF-LTER-'.token_replace('[site:station-acronym]'));
if (stripos($node->biblio_type_of_work, 'masters')) {
$type = "mastersthesis";
}
will evaluate to 0 (i.e. false) for biblio_type_of_work = 'masters' since stripos function is zero base and will find 'masters' in the first position hence 0. See stripos() Following is the how I modified the code (line 330) to fix this and to add in checks for PhD theses. Anything else will get @thesis:
if (stripos($node->biblio_type_of_work, 'masters')!== false) {
$type = "mastersthesis";
} elseif (stripos($node->biblio_type_of_work, 'ph')!== false) {
$type = "phdthesis";
} else {
$type = "thesis";
}
2. Simple way - adding code into the biblo module .../profiles/deims/modules/contrib/biblio/modules/bibtexParse line 365 add .= _biblio_bibtex_format_entry('ltersite','NFS-LTER-ARC'); This of course is for the Arctic LTER.
3. More of a drupal way by adding a field to the biblo content that uses the token for the site acronym. Below are screen shots of the added field and how to modified the biblio module
Adding a token field to the Biblo module.
|
Code to add to the biblo module .../profiles/deims/modules/contrib/biblio/modules/bibtexParse
After Line 364 - .= _biblio_bibtex_format_entry('abstract', ->biblio_abst_e);
Add: .= _biblio_bibtex_format_entry('ltersite', ->field_ltersite['und'][0]['value_token_filtered']);