Solved: Cannot add addThis script to OJS 3.1

Dear all,
addThis was properly working in OJS 3.02. After the update to 3.1, I cannot add the script. When I add the script in the footer (under Website → appearance) or in custom block, the script part disappears and only the text part remains. Here are the imges:

Note: addThis plugin has been activated with proper “Profile Id, username and password”.

Edit: I hardcoded the script in the footer.tpl in child theme and it is working properly.

addThis source code added

addThis code disappears

Regards,
@anupent

OJS has a htmlpurifier which will strip out all script tags from the html you write to a editor window in OJS by default. The allowed tags you can control from config.inc.php, but I would be cautious in allowing the script tag.

In my OJS 3.1 test installation the addThis plugin is working without any problems. I use the default theme and the buttons appear on the article abstract page in the sidebar. So maybe this is a theme issue?

Using the addThis plugin does not require you to add any scripts to the places you mention. You just need to enable the plugin.

1 Like

Thanks @ajnyga,

I am using JatsManuscript theme by @Vitaliy. Maybe the theme does not support addThis scripts/plugin. Vitaliy may consider including this in his upgrade.

For now, my problem is solved with hardcode in the footer template.

Ok, I am not that familiar the theme, but the hook addThis uses is here: https://github.com/pkp/addThis/blob/master/AddThisPlugin.inc.php#L28

Buenos días ,

Lo solucione usando el modulo customHeader-master alli pegué el codigo addthis y todo ok.

Saludos.

2 Likes