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
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

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: Bing [Bot] and 3 guests

cron