Open carakey opened 1 year ago
Sarah Grew for Konturen has specifically asked for this, and even sent information she found in the PKP forum.
Here is a link to the forum discussion about this:https://forum.pkp.sfu.ca/t/how-to-make-italics-in-article-title-in-ojs-3/25598/38 and on github: [https://github.com/pkp/pkp-lib/issues/2564][(https://github.com/pkp/pkp-lib/issues/2564)
Here is the text of one of the solutions:
Hi there,
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
<h1 class="page_title">
{$article->getLocalizedTitle()|strip_unsafe_html}
</h1>
{if $article->getLocalizedSubtitle()}
<h2 class="subtitle">
{$article->getLocalizedSubtitle()|strip_unsafe_html}
</h2>
{/if}
Replace “escape” by “strip_unsafe_html” in /ojs/templates/frontend/pages/article.tpl to strip html tags in the browser’s title bar
{include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedTitle()|strip_unsafe_html}
Add “strip_unsafe_html” in /ojs/plugins/generic/dublinCoreMeta/DublinCoreMetaPlugin.inc in “DC.Title” to strip html tags in DC.Title
$templateMgr->addHeader('dublinCoreTitle', '<meta name="DC.Title" content="' . htmlspecialchars(strip_tags($article->getTitle($article->getLocale()))) . '"/>');
Do the same in /ojs/plugins/generic/googleScholar/GoogleScholarPlugin.inc.php in “googleScholarTitle
$templateMgr->addHeader('googleScholarTitle', '<meta name="citation_title" content="' . htmlspecialchars(strip_tags($article->getTitle($article->getLocale()))) . '"/>');
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
Konturen editors confirmed they plan to continue using the Default theme with their custom CSS.
<i>
or<em>
tags are frequently used in submission titles in reference to another published work (as in a review essay) or for scientific names.Titles should render correctly in italics with no visible tags, on the submission landing page as well the containing issue's table of contents, search results, and in the citation plugin. Currently it looks like the Default theme, Theme11, and most other themes are displaying the
<i>
tags on submission landing pages and in citations, though rendering correctly on issue ToC pages and search results.@wickr handled this previously for OLAQ, so would presumably apply the same fix. Since this is handled in theme files, the fix would need to be applied at least to the combination of the journals using title markup tags and the themes they use. Known journals with title markup tags are Forest Phytophthoras, HSDA, Konturen, and Peripherica. There preferred themes are not yet determined -- but, fixing in the Default theme would help with journals grumbling about the wait for Theme11 / a better option.