I am trying to customize OJS 3.0.2, and I wish to develop a plugin to display the HTML article below the abstract. I have nearly managed, but am stuck at how to get the file contents of a html galley.
I have looked at HTMLArticleGalley plugin, and came across this:
However, i need some one to explain what is happening. I code in PHP, and understand smarty, but there are too many variables and DAO and extensions of objects to keep trace.
I cannot find a list of functions for a galley, and this is limiting my work.
What you do need to think about is what to do with the HTML. You could replace the _parseXML function with a function that only gets the HTML between the body tags. If you embed the full html, you will end up with unvalid html.
By default it’s apache error.log. Without error logs its impossible to find out causes of troubles. OK, I will prepare plugin for front-end developing at the end of the week. You can try than.
I have seen your and vitaliy’s code. I think I am slowly getting there.
If i am correct, first register the plugin to a hook, then get the html content: i will be using DOMdocument to select only the body, and then strip the
Then I attach that to the smarty template (this is where I dtill need smoe time)
If I download one plugin, how can I add it to OJS? the admin pages still do not show a way of doing this. Should I just upload by ftp in the directory?
I have tried using ajnyga’s plugin, and started to modify, but I do not know how the plugin gets called in the first place.
I have a button on the page, to load this html: but I do not understand how to trigger the plugin, like the default action when one clicks on the Galley links.
I am actually thinking of doing all this by addin some php file, and load dynamiccally via javascript, but I still need access to the article classes as used by OJS
The lack of a tutorial / reference to formulate a plugin is frustrating.
The way embedGalley works is that it detects whether the article has XML galleys. If it has, it will then open the XML galley file, convert it to HTML, run a few HTML filters and then embed that HTML to the article abstract page.
You just need to have the plugin activated and add a JATS XML galley to an article. Everything else is automatic.
If you click on a galley link, it will open a different view than the abstract page. I understood from your first post, that you want it under the abstract?
There is no need fully understand OJS code to make a plugin. Moreover OJS is complicated system, that evolved for a very long time.
On what stage you have stuck?:
Getting HTML from a galley?
Assigning variables to smarty?
Making Smarty template?
Connecting to a hook?
I have made a lot of progress over the last few days.
I have managed to read the html galley, and get it into the abstract page.
However, I am not using a plugin approach - i will try that later once I get everything in order. I have instead hijacked the code, and included some php to deal with the requests.
Now i need to know how to get the Journal short path. Would anyone know how to access it from php, smarty?