I agree with @jmacgreg: we need a solution please that allows italics tags but strips them out for metadata. I’ve just upgraded our journal to OJS 3.1.0.1 and it is very disappointing to find that the italics tags that worked perfectly well in article titles for many years with OJS 2.x now do not render as we intended. I would stress, too, that this issue – the need for italicized words in the titles of academic articles – applies just as much to my field (musicology) and the rest of the humanities as it does to the biological sciences mentioned above, for humanities articles’ titles frequently refer to foreign-language words or existing literature using the normal convention of italics.
I’ve done the following to make italics work in article titles, but exclude them from metadata (DC.Title and citation_title) and the browser’s title bar.
You need to change some templates - there might be a better way to do it, but it works for me.
Replace “escape” by “strip_unsafe_html” in /ojs/templates/frontend/objects/article_details.tpl in the “title” and “subtitle” to make italics work on the article’s frontdoor
Et voila - you will have italics an your article’s frontdoor, but no “em” or “i” html tags in the browser’s titlebar or in the DC.Title / citation_title metadata
My thanks to @bibliothekswelt for his solution above: it works for me. However, could the same fix (interpreting the italics tags in articles’ titles) be applied to the various citation formats too?
Paul
I’m interested how you make sure that you get the latest changes in a template, when a new OJS release is coming out. Do you manually check every change/overridden template for changes? Or have you some automated workflow in place?
at the moment we don’t have a workflow in place. The corrections should be added to a new OJS version, so I think the best way is to make a pull request in GitHub. However, I haven’t worked with GitHub yet, so I have to do a bit of “research” first, how to make this correctly.
do you know what will happen with the html tags in regards to DOAJ for example? The DOAJ expects (akaik) plain text titles. We acutally had an article where <em> tags leaked over to the DOAJ. Will this still happen with your fix in place?
I think it would be the best to wait till the entering of html in the title field has been implemented properly and afterwards look for templates/plugins that expect plain text instead of html and make them handle the html properly. Then we don’t end up with unintended behaviour.
albah, Just like egroll said:
I changed in /templates/frontend/objects/article_details.tpl the line {$article->getLocalizedTitle()|escape} into {$article->getLocalizedTitle()|strip_unsafe_html}
It seems to me that the need for italics in article titles has been a bit downplayed by the developers here: it would be absolutely necessary in many disciplines. Also, it would be great if the new implementation would take into account the fact that hundreds of titles exported from earlier versions of OJS would have html tags (<i> and <em>) in them. I have not deleted them in the 10 or so journals that we have migrated to OJS 3, in hopes that some day the italics would automagically appear again
The latest update (as of today) on the git issue linked above is from June, indicating that the UI/UX changes introduced with recent vue.js work (which will be released with OJS 3.2) will facilitate things like adding italics support for titles. This may look like a minor change at first glance but you can see from the discussion there that it involves a lot of work and good alignment with other work in progress.
Regards,
Alec Smecher
Public Knowledge Project Team
I am also following on this subject, because I really find this issue relevant (the possibility to show italic on titles and subtitles, since almost all the authors make use of them).
So I am looking forward for the 3.2 to come out.
All the best
Leonardo