HTML Galleys in OJS 3

Hi PKP team,

I was hoping to clarify the HTML galleys that are uploaded in OJS 3. In OJS 2.x, HTML galleys were displayed within the larger OJS theme, and included the matching header/footer/sidebar/etc. In OJS 3 (this is a dev migration to 3.0.2), it looks like HTML galleys that are uploaded are rendered as-is.

Is this the expected behaviour in OJS 3.x? And are there any plans to change this, or will this be the way HTML galley uploads will be handled now?

Thanks so much!

1 Like

Hi @kaitlin,

In OJS 2.x, we jammed the complete HTML document inside the existing OJS layout, leading to an article HTML structure that looked something like…

<html><!-- This part comes from OJS -->
 <head>...</head>
 <body>
  <html><!-- This part comes from the HTML galley -->
   <head>...</head>
   <body>...</body>
  </html>
 </body>
</html>

Note the duplicated <html>, <head>, and <body> elements. This is illegal HTML, though browsers seem to accept and render it. The changed approach in OJS 3.x fixes this.

If you’d like to include the OJS layout in OJS 3.x HTML galleys, you’ll need to include OJS’s CSS (or something OJS-like) in your HTML.

The other change with OJS 3.x is to dedicate more screen real estate to the content in both HTML and PDF views; the OJS 2.x galley layout was too inefficient with space.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for the quick response @asmecher!

Hi @asmecher,

we have one journal with pdf and html galleys. When we upload correct html files OJS (v.3.1.2) still seems to duplicate the <html>, <head> and <body> tag.
see e.g. https://www.o-bib.de/article/view/5120/7550

What can we do to display correct html?

thanks, Anna

Hi @akku,

Does anything relevant appear in your PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

there are no error logs referring to html display problems.

thanks,
Anna

Hi @akku,

Are you using any third-party plugins relating to the display of HTML content?

Regards,
Alec Smecher
Public Knowledge Project Team

HI @asmecher,
no, we only use the available ojs plugins (html galley, bootstrap3). We upload the html galleys together with the pdf galleys and publish the files as displayed. During the upload process the additional (unecessary) html tags are generated.

best regards, Anna

Hi @akku,

Can you try the default theme for a moment, to see if the issue is with the Bootstrap3 theme?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I tested it, but unfortunately I also get e.g. 3 body tags, if I use the standard theme.

regards, Anna

Hi @akku,

Normally OJS will show an HTML galley in an iframe, but yours is embedding the content directly in the page. It’s pretty likely that you’re using a plugin to do this. Are you sure that’s not the case?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
sorry, I think I misunderstood your question referring to the plugin. We use the “html galley” plugin, but I thougth this is a generic plugin?

As the html files weren’t displayed well, I had to do some adoptions, see: Problem styling HTML Galley OJS 3.0

Could this be the reason for the malformed html tags?

thanks, Anna

Hi @akku,

Yes, I suspect those changes are the source of the problem. You could try temporarily removing the changes and seeing if it works.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

yes, you are right, the changes produce malformed html. But without the changes our html-files are are not embedded into the journal’s layout (on our testsystem): https://o-bib-ojs3test.ub.uni-muenchen.de/article/view/5415/7430

Others seem to have the same problem: https://journals.ub.uni-giessen.de/justdemo/article/view/5/114 or https://journals.ub.uni-heidelberg.de/index.php/frrec/article/view/59799/52455

So, is there another way to display our html files nicely and produce wellformed html?

thanks, Anna

Hi @akku,

At the moment, those are unofficial changes and aren’t wrapped up e.g. in a theme or plugin, so your mileage may vary. However, I’ve asked one of the developers who’s working with it whether he’d be able to have a look and possibly package it up more portably.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

thank you very much for passing the problem over. Hopefully somebody has a solution.

best regards,
Anna

Hi @akku,

I would suggest making additional modifications of HTML galley file before displaying to drop meta tags. e.g. with PHP DOM.

I haven’t done this for HTML, but if you are planning to use JATS XML for publication you can look at: https://github.com/Vitaliy-1/JATSParserPlugin

Hi! I would support @akku’s question. Are there any other suggestions on how to display HTML-galleys like here (within the journal layout) and not like here (in a separate window) :slight_smile:

It seems in some cases the ‘right’ layout may work just ‘out of the box’ :slight_smile:

I am planning an upgrade to OJS 3 and running into this as well. If we lose all our CSS, navbar, headers, sidebar, footer, etc like we had automatically from the OJS 2, how can we upgrade? Many articles have their own custom CSS files uploaded as well, along with our custom CSS for the website itself. It would be a nightmare to edit all our previous HTML files to include all this content at this point, let alone managing updates if/when we modify our theme’s CSS over time.

Are there any tools or plugins to help with this?