I’m using OJS 2.4.4.1 and was looking for a social media share widget for the sidebar. I’m surprised this isn’t default or that none exist, unless my searching is subpar?
I tried using sharethis.com and copying the code into the custom block plugin, but that didn’t work as it strips out the html and I don’t know where to place the script code that is suppose to go in the head.
Any suggestions on how to add standard facebook, twitter, G+, etc icons so users can share articles on their social media pages?
I haven’t tested this myself, but you ought to be able to put arbitrary HTML into the custom block – just make sure you go into HTML mode in the TinyMCE control and paste the code there.
Yeah adding follow buttons is fairly easy and straightforward. It’s the share that’s a little more tricky because it involves scripts and checking to see if the user is logged in to their own social media or not. I would like to give users the ability to share links to our articles on their own social media with just a click.
I found a sharethis.com competitor called addthis.com that uses a simpler HTML that the custom block didn’t reject. But it also calls for adding a script to the body tag.
Thanks Alec for prompt reply.
I would like to have two components i.e. Firstly, Follow us social media buttons on landing (home) page and other static pages. Secondly, Share social media buttons on Current issue, Archives, and individual articles page.
Your help in this regard is appreciated.
On static pages (and I believe also the homepage), you can enter the
ShareThis markup into the setup fields to have it display there. For the
issue and article pages, your best bet is probably to edit the template
files and insert it there. Note that you’ll probably need to use the
Smarty {literal} tags when editing templates to avoid accidental interpretation of { and } characters; see the Smarty documentation for more information.
Regards,
Alec Smecher
Public Knowledge Project Team
Could you provide more detailed instructions on how to connect AddThis plug-in (OJS 3.0.2) to article pages by means of template editing? Which code should I add to the template?
At the moment addThis is hooked to Templates::Article::Details, in the default theme that is basically the right sidebar on the article page where you will also see for example the “How to cite” block.
1.AddThis plug-in installed at /plugins/generic/addThis-master/
2.I see the following entries in the article_details.tpl (/templates/frontend/objects/):
*Core components are produced manually below, but can also be added via plugins using the hooks provided:
*Templates::Article::Main
*Templates::Article::Details
and {call_hook name=“Templates::Article::Details”}
3.What should I add to the template to “activate” AddThis hook?
One more remark. We are using https for OJS. Thus AddThis plugin causes a warning in Google Chrome about unsafe scripts. So I just edit addThis.tpl changing script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js to src="https://s7.addthis.com/js/250/addthis_widget.js. No warnings anymore.
That won’t fully install the plugin. Try removing it e.g. via FTP, and then download the .tar.gz file from the Releases area, and upload it via the Plugins tab of the journal settings.
Regards,
Alec Smecher
Public Knowledge Project Team
I have deleted the plugin by ftp, but when I try to install the plugin through the tab, the system tells me that “The uploaded file does not contain a folder that corresponds to the plugin name”