OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Accessing journal settings in a Smarty template

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.

Accessing journal settings in a Smarty template

Postby aidanfindlater » Sat Sep 23, 2006 1:42 pm

I'm trying to access the displayCurrentIssue journal setting from my template, but can't figure out how to.

The template at templates/manager/setup/step5.tpl simply references {$displayCurrentIssue} but that doesn't work from templates/index/journal.tpl. I ended up adding a line to classes/template/TemplateManager.inc.php to provide this variable. This works just fine, but I'd rather leave the code base untouched to make upgrading easy. How is it that the step5 template can access it but the journal template cannot?

I admit that this is my first foray into Smarty templates -- sorry if the answer's obvious!
aidanfindlater
 
Posts: 5
Joined: Sat Sep 23, 2006 1:35 pm

Postby asmecher » Sun Sep 24, 2006 4:30 am

Hi aidanfindlater,

The code that allows the setup pages to access journal settings is in classes/manager/form/setup/JournalSetupForm.inc.php. If you want to access the displayCurrentIssue setting from another template, you should be able to use something like:
Code: Select all
{$currentJournal->getSetting('displayCurrentIssue()}
FYI, upgrading modified code without losing the customizations is possible using the patch-based upgrade method. (Of course, this may mean some manual merging of changes, depending on where the customizations are and what has changed between versions of OJS.)

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests