I am actually thinking a situation where you compare statistics for journals using the plugin and for journals not using the plugin. Our site theme has a “top articles of the week” stat in the site front page. At the moment it is counting the downloads, but that is of course not fair for journals with embedded HTML. I will have to find out what COUNTER says about this.
Do you know if there are some meta tags etc. for Google scholar to tell that the full text is on that page? I was looking that it would be maybe possible to add a feature to embedGalley that adds the XML references and list them for google scholar: Improve Google Scholar exposure with reference metatags!
For start I wished to test plugin statically. It works only with several articles and with $smarty->get_template_vars('publishedArticle'). So the object PublishedArticle in most cases returns null. As for Article object there is a weird things to. For example, in 2 articles it returns articles with other id (and all the data). In several cases it not returns galleys.
this is weird, because I have not encountered a similar problem with embedGalley. I mean the article object should be there always, because it is the article page. Do you have similar problems with embedGalley if you test it with the same articles?
Ok. I will test with embedGalley plugin. As far as I can see the problem is related to the hook, that is used. With Template::Article::Main hook all seems to be OK, but not with Footer hook.
Before doing more work, I want also to ask you the best way to expose article with PHP. My idea, after taking a look at the OJS code more precisely, is parse XML into POPO objects, assign data to the variables like here: https://github.com/Vitaliy-1/JATSParserPlugin/blob/master/JatsParserPlugin.inc.php#L156 and expose them through tpl file. In this case front-end will be generated according to smarty native way. What do you think about this approach?
And one more question is about order inside the hooks. Did you figure out how to change it, because in my case article statistics goes before the article main text?
Have tested embedGalley plugin. The problem occurs with several articles. From error log: PHP Fatal error: Uncaught Error: Call to undefined method Article::getGalleys() in plugins\generic\embedGalley\EmbedGalleyPlugin.inc.php:147
Also Recommend Articles by Author plugin not always working. They both use Footer hook. I think the reason is in loading order. Maybe this plugins are loaded actually before the Article object is created? Is it possible?
Edit: seems to be a conflict between this plugins. After disabling the latter embedGalleys works fine.
I want completely change the front-end look of articles. Do it more PLOS- or elifesciences-like Don’t know if it is better to do it with javascipt or change theme files. Also I am not aware how will work assigning ArrayObjects to smarty templates.
Article (abstract, main metadata, maybe full text)
How to cite (this takes a lot of room at the moment)
Authors (if author biographies available)
Statistics (if enabled, the problem is that at the moment the stats plugin is just hooked to a multipurpose hook. You would have to add a new hook and fork the stats plugin to hook it in the right place)
References (if available)
A have a work on progress theme that uses Jquery UI tabs (Tabs | jQuery UI).
Another way of making room to the abstract page would be using these Accordion | jQuery UI in the abstract page side bar.
I have a feeling that return false will prevent other plugins from using the same hook? @asmecher?
edit: note to self, I have that in embedGalley as well… But I recall reading (can not remember where) that return false would prevent other plugins from using the hook. I could be wrong here. I can not test that right now so if you can let me know, thanks!
Nope. Not helping. There is a need to note that, for example, with the last article embedGalley works on primary locale and not working with second locale. The same case if for recommend by author. But I don’t understand why is so, because for the 80% of articles all works fine.
I have a feeling that this would be a problem with any plugin using that hook and maybe also with the other hook you mentioned if other plugins use that. I will test embedGalley next week together with the other plugin. Maybe Alec with comment by then.
Here I have just iterated through journal article reference item object @ajnyga, @asmecher, what do you thin about writing to Smarty templates this way? I mean is this OK to iterate through objects in template file? Or it is not OK in terms of speed or security? Don’t know Smarty so it’s better to hear yours point of view before writing actual code.
The final work will have presumably 500 lines of code. It would be broken into several template files for readability.
The HOOK_SEQUENCE_… constants are HOOK_SEQUENCE_CORE, HOOK_SEQUENCE_NORMAL, HOOK_SEQUENCE_LATE, and HOOK_SEQUENCE_LAST (in order of high to low priority).
Regards,
Alec Smecher
Public Knowledge Project Team