OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



[OPEN] Generic plugin: Template overwriting or updating?

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.

[OPEN] Generic plugin: Template overwriting or updating?

Postby mbria » Thu Jun 11, 2009 10:13 am

Dear fellows,

I'm developing a generic plugin to extend OJS to allow Authors and Editors submit metadata keywords based on a fixed thesaurus.

In other words, we decided to integrate OJS with "tematres" (http://www.r020.com.ar/tematres/) via "tematresview" (ajax2webservices) and as far as we can see, the thesaurus part is now working great:
http://www.comunitic.net/tematres
http://www.comunitic.net/athenea/plugins/generic/thesaurus/tematresview/view_thesaurus.php
(Notice: only a few terms are added to this brief test vocabulary, so if you visit those links, try with looking for "Poder" keyword)

After this, OJS manual and plugin examples were really helpful to me to create the module settings' interface so as you can imagine, next step I wanted to deploy was attaching (= smarty including) "tematresview" snippet to the following form templates:

/templates/author/submit/step2.tpl
/templates/submission/metadata/metadataEdit.tpl
(xxx/index.php/myJournal/author/submit/2?articleId=999
xxx/index.php/myJournal/editor/viewMetadata/999)

And here was when I was on trouble because but I can't manage to find where to "hook" or how to overwrite the default template from my new module.

I mean (let me repeat because my English is really bad) I can easily change the "metadataEdit.tpl" adding the required Javascript and HTML to let tematres work with OJS (replacing "metaSubjectClass-section" at each template, with the new code) but this solution is like a fork so won't be easily portable and updatable... and I think this could be a useful plugin for OJS community.

I imagined a couple alternative solutions (play with the template variables to hide those fields, filter the created template with smarty register_outputfilter()...) but I suspect "template overwriting" (or updating) is the best one.

Be confident if I'm not on the right way or it can't be accomplished at this moment with OJS.

With this idea on my mind I dig into this forum and the only thread I read about this is:
http://pkp.sfu.ca/support/forum/viewtopic.php?f=2&t=3427&start=0

Any suggestion?
Could somebody help me with this?

Thanks a lot in advance,

m.
mbria
 
Posts: 292
Joined: Wed Dec 14, 2005 4:15 am

Re: [OPEN] Generic plugin: Template overwriting or updating?

Postby mbria » Tue Jun 16, 2009 9:47 am

No comments about this thread?

Cheers,

m.
mbria
 
Posts: 292
Joined: Wed Dec 14, 2005 4:15 am

Re: [OPEN] Generic plugin: Template overwriting or updating?

Postby asmecher » Wed Jun 17, 2009 3:33 pm

Hi mbria,

You might want to have a look at a few things that've gone into the CVS version with this feature (controlled sets for keywords) in mind -- nothing that'll take you all the way, but a few necessary steps. Unfortunately they're coded with the forthcoming OJS 2.3 in mind, which is a considerably further-developed codebase than the stable release, but you should be able to back-port or at least get a preview of what we're working on.

In the PKP library (which will be part of our releases from 2.3 onwards), there is a bunch of code in classes/controlledVocab for abstract support of controlled vocabularies. This can be used to take care of managing the set of keywords available for use. See http://pkp.sfu.ca/cvs/cvsweb.cgi/pkp/classes/controlledVocab.

We've also reconciled a couple of the templates that were responsible for displaying metadata, so there will be one or two less in future releases. The next step will be to break those templates up into smaller pieces so that plugins and other code can rearrange and override the built-in metadata set.

While some of this won't be suitable for back-porting into OJS pre-2.3, the controlled vocab stuff in particular shouldn't be too difficult to use.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8419
Joined: Wed Aug 10, 2005 12:56 pm

Re: [OPEN] Generic plugin: Template overwriting or updating?

Postby asmecher » Wed Jun 17, 2009 4:00 pm

Hi all,

FYI, there's a Bugzilla entry at http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=3892.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8419
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Development

Who is online

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