OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Getting a "volume number" and "issue" number from issueid

OJS development discussion, enhancement requests, third-party patches and plug-ins.

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.

Getting a "volume number" and "issue" number from issueid

Postby tarek » Wed Oct 20, 2010 5:03 am

Note: I accidentally posted this to OCS Development, though the project is OJS. I'm reposting here, and hopefully one of the mods will erase the OCS thread.

Hello all,

I am having some tremendous success with the rolling TOC that I've finally had the chance to work on. One interesting issue remains: I can't derive the Volume and Issue numbers.

The goal is to have it look like:

Vol. 4(1) (for example)

The code I used:

Code: Select all
Vol. {$issue->getVolume($article->getIssueId())}({$issue->getNumber($article->getIssueId())})


Predictably, $issue->getVolume() actually takes no notice of what's inside the brackets. I also tried to set the issue with $issue->setIssueId($article->getIssueId()) before executing the above, but - unsurprisingly - that didn't work either.

Before I create a new function akin to getVolume, am I missing something?

tarek : )
tarek
 
Posts: 14
Joined: Thu Jun 21, 2007 4:00 am

Re: Getting a "volume number" and "issue" number from issueid

Postby tarek » Wed Oct 20, 2010 6:40 am

To answer my own post..

In the pages associated with wherever you want to show volumes and numbers, add the following code:

Code: Select all
$issueDao = &DAORegistry::getDAO('IssueDAO');
$templateMgr->assign('issueDao', $issueDao);


Then in the relevant page template, use the following inside the article "foreach" or whatnot:

Code: Select all
{assign var=issue2 value=$issueDao->getIssueById($article->getIssueId())}
Volume: {$issue2->getVolume()}
Issue: {{$issue2->getNumber()}


tarek : )
tarek
 
Posts: 14
Joined: Thu Jun 21, 2007 4:00 am


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests