Software Hosting and Development Services available at PKP Publishing Services
As the developers of Open Journal Systems, Open Conference Systems, Open Harvester Systems, and Open Monograph Press, the PKP team are experts in helping journal managers and conference organizers make the most of their online publishing projects. PKP Publishing Services offers support for:
As a customer of PKP Publishing Services, you will not only receive direct, personalized support from the PKP Development Team, but will be contributing to the ongoing development of the PKP applications. All funds raised by PKP Publishing Services go directly toward enhancing our free, open source software. For more information, please contact us.
OJS development discussion, enhancement requests, third-party patches and plug-ins.
Moderators: jmacgreg, michael, jheckman, barbarah, btbell, bdgregg, 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.
by juli » Wed Jan 23, 2013 4:51 pm
Hi all!
I'm working i a new generic plugin to display the issues archive in a list inside the journal index (first page).
I would like to make a plugin to insert a code after the main content and before the footer. I have show in the templates/index/journal.tpl some variables like additionaHomeContent, but I cannot set a value to it. Also I tryed to copy the code of announcementFeed and piwik module to get similar working but I haven't any result.
I think that I must use a Hook but I not understand wichone, the Template::manager::... and templateManager::... seems to be appropiate but no one works for me.
Also the technical reference examples and hook list not solves this problem.
Please, any help will be great.
thanks a lot
-
juli
-
- Posts: 7
- Joined: Mon Jul 16, 2012 1:18 am
by juli » Thu Jan 24, 2013 12:47 am
Hi Alec,
thanks a lot for your fast reply. I have tryed with the
- Code: Select all
php tools/upgrade.php upgrade
And also I have cleaned the data and template cache. Any more ideas?
this is my code:
- Code: Select all
import('lib.pkp.classes.plugins.GenericPlugin');
class IssueCarouselPlugin extends GenericPlugin {
function register($category, $path) {
if (parent::register($category, $path)) {
if ($this->getEnabled()) {
HookRegistry::register('TemplateManager::display',array(&$this, 'callbackAddLinks'));
}
return true;
}
return false;
}
function getDisplayName() {
return Locale::translate('plugins.generic.issuecarousel.displayName');
}
function getDescription() {
return Locale::translate('plugins.generic.issuecarousel.description');
}
function callbackAddLinks($hookName, $args) {
if ($this->getEnabled()) {
$templateManager =& $args[0];
$requestedPage = Request::getRequestedPage();
// if we have a journal selected, append feed meta-links into the header
$additionalHeadData = $templateManager->get_template_vars('additionalHomeContent');
$templateManager->assign('additionalHomeContent', $additionalHomeData."\n\t TEST");
}
return false;
}
}
Any help will be realy useful. Thanks a lot.
-
juli
-
- Posts: 7
- Joined: Mon Jul 16, 2012 1:18 am
by asmecher » Thu Jan 24, 2013 9:41 am
Hi Juli,
I would suggest using "die()" calls to test whether certain parts of your code are getting called. For example, is the "register" function getting called? Is the hook getting registered? Is the callback getting called?
Regards,
Alec Smecher
Public Knowledge Project Team
-
asmecher
-
- Posts: 5759
- Joined: Wed Aug 10, 2005 12:56 pm
-
by juli » Fri Jan 25, 2013 2:42 am
Hi folks,
My error was that I forgot the version.xml file. I added it, called upgrade (php tools/upgrade.php upgrade), clear caches and get it working.
thanks a lot, when I finis I will release it!
-
juli
-
- Posts: 7
- Joined: Mon Jul 16, 2012 1:18 am
Return to OJS Development
Who is online
Users browsing this forum: No registered users and 0 guests