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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

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: No registered users and 1 guest