OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



new bibliographic format

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

new bibliographic format

Postby spliff » Fri Jun 22, 2007 2:10 pm

Hi everybody,

this must be easy for you php Pro's out there...

I modified the bibliographic format "Turabian" a little bit in order to get a format that makes sense for my journal.

The code

Code: Select all
{elseif $bibFormat == 'Turabian'}
   {assign var=authors value=$article->getAuthors()}
   {assign var=authorCount value=$authors|@count}
   {foreach from=$authors item=author name=authors key=i}
      {assign var=firstName value=$author->getFirstName()}
      {$author->getFirstName()|escape} {$author->getMiddleName()|escape} <i>{$author->getLastName()}</i>{if $i==$authorCount-2}, {elseif $i<$authorCount-1}, {else}.{/if}
   {/foreach}

      {$article->getArticleTitle()|strip_unsafe_html}, in: Zwingliana {$issue->getVolume()}/{$issue->getNumber()|escape} ({$issue->getYear()}), {$article->getPages()}.


gives me something like:

John S. Smith, May B. Brown. Title: Subtitle, in: Zwingliana 1/1 (1900), 21-24.


So far this is fine. Now at some point in the past the journal changed its publication frequency: Instead of volumes with several issue numbers there were only volumes anymore.
The above mentioned code gives me in such a case:

John S. Smith, May B. Brown. Title: Subtitle, in: Zwingliana 30/0 (1990), 21-24.


How do I have to modify the code in order to avoid "/0" in case of no issue number? There must be somewhere an "if" and an "else" but I am not familiar with the syntax...

Best regards
spliff
 
Posts: 28
Joined: Thu Jun 14, 2007 8:23 am
Location: Switzerland

Postby asmecher » Fri Jun 22, 2007 3:33 pm

Hi spliff,

Edit templates/rt/captureCite.tpl and find the chunk that displays the issue number:
Code: Select all
{$issue->getNumber()|escape}
Change this to:
Code: Select all
{if $issue->getNumber()}{$issue->getNumber()|escape}{/if}
That should be all you need to do.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Postby spliff » Sat Jun 23, 2007 2:33 am

Hi Alec

That's it. Very simple, and it works :D
Thanks a lot!
spliff
 
Posts: 28
Joined: Thu Jun 14, 2007 8:23 am
Location: Switzerland


Return to OJS Technical Support

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests
http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=2036
pkp.sfu.ca
crawl=CC-MAIN-2015-18
25981
application/http; msgtype=response
sha1:73QBJ3JZNMB6HB7PB7AZ2ZMDEFDLZZ7N
<urn:uuid:d31e7420-7a0c-4e6e-b7d3-cb10286528c7>
2015-04-26T21:03:22Z
142.58.129.159
sha1:QYMS5IUT7XUTHFATQO5O5ZKPRB22U7IX
<urn:uuid:b6bdb7a6-6f3e-4dba-883f-f110f5772e8a>
http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=2036
length
response
<urn:uuid:df78a48e-4044-423f-9fcc-05b6d123dc23>
robots: classic
hostname: ip-10-235-10-82.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2015-18
operator: CommonCrawl Admin
description: Wide crawl of the web for April 2015
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf