How to make italics in article title in OJS 3

Hi!
How can I italicize biological names in titles of article. This is important, because a lot of articles containe biological names in their titles. My version is OJS 3.0.1
Thanks for help!

1 Like

Hi @novikoffav,

We currently don’t support HTML tags in article titles, but would if we can identify an appropriate UI tool for entering HTML content for single-line fields. See some relevant discussion over here: https://pkp.sfu.ca/bugzilla/show_bug.cgi?id=6759

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

@asmecher, but it was realized in OJS 2, as I understand. For example, in Phytotaxa who runs OJS (http://www.mapress.com/j/pt/article/view/phytotaxa.286.1.1) all names are italized. What is the difficulty now?

Hi @novikoffav,

That behavior wasn’t ideal as it tends to cause trouble if people want to enter <, >, and & characters in submission titles (which I suspect is more common than needing italics/underlines/etc). To do it properly in the OJS 2.x way, they’d need to use &lt;, &gt;, and &amp; entities instead of those characters, which is unexpected.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher!
Well, you are right, using of ampersand and specsymbols is a common issue. But italization is realy important in biological sciences. So, I wonder if there is at least the way to edit code of the article page, when the title in database could stand not italized. Or to add into OJS article form the field like article title displaying in the web…

Hi @novikoffav,

I’ll pass this around our UI/UX group for discussion.

Regards,
Alec Smecher
Public Knowledge Project Team

I’m curious about support for this because any of the metadata standards I think think of explicitly disallow visual markup for titles… take for example: Dublin Core, MODS, CrossRef, etc. I’m not trying to speak against having more rich metadata within the product (because it can always be dumbed down for specific exports), but I am curious as to why this is not a broader question within existing metadata standards. (Or maybe I’m just missing / misreading it.)

Hi @ctgraham,

From a developer perspective, I’d probably pass it through strip_tags (or potentially PKPString::html2text) en route to a format that didn’t support HTML, which is to say, most of them. But your point is well taken – if all the infrastructure that OJS has to communicate with won’t support formatting in titles, then we’re likely to introduce an impedance mismatch.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,
I am sure that there no need to make changes in metadata. But if there is some possibility to modify how the title will appear on the page, then it will be realy great. All biological journals dealing with italics because it is under regulation of biological codexes and must to be, so it is common situation. But, no of them are really input italics in metadata. Here are examples of PosOne, Phytokeys, and Annals of Botany. These journal use different platforms, but all of them implemented italics in pages and noone - in metadata.

Hi,

An alternative way would be to introduce a secondary title field in the metadata form (possibly only for the editors), which would allow html and you could use that field instead of the actual title in your theme.

This would probably be possible with a plugin as well.

Edit: but don’t get me wrong: a solution with one field and built in the core would be great! I have at least one journal that has been asking about the same thing.

Edit2: or the combination of those two options:

We (Contributions to Entomology) will go online with OJS 3 and we need the same feature in the title of the article. To mark names of species or genera with HTML tags would be a simple way. From the point of view of metadata an additional tag is another option.

Hi @novikoffav, I could solve the rendering problem of italicized taxa names in article title in OJS 3.02. First some resume:

Table of contents: sufficient without intervention

Citation format(s): sufficient without intervention

Article detail page: I changed in /templates/frontend/objects/article_details.tpl the line {$article->getLocalizedTitle()|escape} into {$article->getLocalizedTitle()|strip_unsafe_html} just as it is done with the abstract. To make this code sustainable, I did this in a child theme derived from the default theme.
@asmecher could it be coded in the original if this is no security risk?

(Invisible) metadata: the HTML tags <em></em> appear in HTML <title>, and in <metadata> DC.titel and citation_title. Don’t know if it is necessary in <title>.

By the way, the are some other bumps:

The abstract is rendered by {$article->getLocalizedAbstract()|strip_unsafe_html|nl2br}, but because TinyMCE wraps paragraphs in <p></p>, nl2br causes additional space between the lines.

TinyMCE wraps italic in <em>…</em> and bold in <b>…</b>, but underlined text in <style style="text-decoration:underline;" >…</style>. Is there a reason?

Best wishes!

2 Likes

Hi @egroll,
It suppose to be a good idea, but, as I understand, problem with italics in title is that they can cause later problems with metadata processing. So we need at least an advice of @asmecher .

Hi @novikoffav,

We don’t have concrete plans on this front yet, but as you note, the issue is being able to provide high-quality titles both with rich formatting (per your requirement) and in plain-text (per many of the third party standards you’ll need – Dublin Core e.g. via OAI, CrossRef, etc).

The title is such an important field that I think it would be necessary to have two fields – “rich” title and “plain text” title – rather than having OJS make assumptions about how to convert content from rich to plaintext or vice versa.

There are two impediments to consider before this is ready to implement: first, we don’t have a good tool to permit single-line rich text entry. TinyMCE works well for multi-line fields but not for shorter ones. See bug #6759 for some older conversation on this. And second, most users won’t want to be presented with two “title” fields for each language they use, so some usability considerations are necessary.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @novikoffav, hi @asmecher.

Maybe I’m off the track. But there are already two records for every article title “title” and “cleanTitle” in the database of OJS3 (table “submission_settings”). And actually “title” contains the title with HTML tags (e.g. <em>) and “cleanTitle” without tags. Well done!

In the frontend (default template), this is obviously not yet implemented. That is why I had summarized this in my last post. So if there are no fundamental concerns about titles with HTML tags, this question has already been solved except a litle bit fashioning (change “escape” into “stripe_unsafe_html” and use “cleanTitle” in metadata).

The input of rich text remains open. However, this is done by the editor in my case.

Best regards

Hoping to see some solution here. I have made basically the same changes to our site to enable the italics as @egroll described.

If the solution is to have two separate fields (rich and plain-text) then this would have to apply to the subtitles as well resulting into four title fields (Bad!).

A while back I tried to look for a rich text editor for HTMLtext input field, but surprisingly there seems to be none (Sad!)? However, I do think that this feature could be implemented even without an editor. If raw HTML is a problem, then maybe a limited tag set of Markdown?

Hi @ajnyga,

Markdown is certainly a possibility – I’d want to make sure whatever approach is used will map cleanly from markup to text (Markdown or a limited subset of it would be a possibility), and I’d also want to check for options in including formulae (see this helpful survey) and there is an equivalent that’s currently escaping me for taxonomies (biology), if I recall correctly.

I would want to consider a unified approach – I think it’s confusing to have Markdown in some places and HTML (TinyMCE) in others. I wonder if single-field Markdown editors are available more broadly than TinyMCE (and alikes) are.

Another option might be to provide tools to spin out rich/plain editors for important fields like this – i.e. the regular plain-text field is almost always what gets used, but occasionally editors might choose something richer. That wouldn’t take much real estate, and I’d argue that automatically mapping to/from rich is guaranteed to make someone unhappy.

@egroll, the plainTitle is intended for search indexing, and probably isn’t useful for this purpose – but it is a rough parallel of how we might manage a couple of parallel settings for various purposes.

Regards,
Alec Smecher
Public Knowledge Project Team

The only solution I found for formatting the title in OJS is to import the articles from XML (using the XML import plugin).
You can use the < ![CDATA[< i>]] > (without the spaces between >< symbols) tag for the beggining of the italic format, and end it with < ![CDATA[< /i>]]>. This also works with strong, u (underline), em (emphasis), and other HTML tags.

THE ONLY PROBLEM IS THAT, IF YOU USE THIS METHOD, YOU WILL LOSE ANY HISTORY OF ARTICLE SUBMISSION

Formatting title in italics, bold or underline would be a useful feature for us too. We host a recension journal and people would like to format e.g. the title of the discussed book in italics.

@egroll @novikoffav Are you using the described workaround (code change in article_details.tpl) in a productive environment? The downside would be that the metadata output (like DC, citation format exports) will include the tags, is it right?

Hi all,

IIRC OJS 2.x allowed people to manually enter HTML tags into titles, and then stripped out those tags wherever they were unnecessary or problematic (using strip_tags as Alec suggested in Post 8). Would this not be a reasonable compromise for the time being? I’d be concerned about making “rich” and “plain text” options - that seems fairly complicated for the use case.

Cheers,
James

1 Like