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
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.

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: 7734
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest