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}

      {$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
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
Change this to:
Code: Select all
{if $issue->getNumber()}{$issue->getNumber()|escape}{/if}
That should be all you need to do.

Alec Smecher
Public Knowledge Project Team
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
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!
Posts: 28
Joined: Thu Jun 14, 2007 8:23 am
Location: Switzerland

Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 5 guests