OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Adding face book button to the footer, code disappears

Are you responsible for making OMP work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, asmecher

Forum rules
What to do if you have a technical problem with OMP:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OMP Discussion subforum; if you have a development question, try the OMP Development subforum.

Adding face book button to the footer, code disappears

Postby stefan » Thu Jan 23, 2014 12:24 pm

Hi,

I successfully added a twitter button and a follow button, but cannot get facebook to work:

This is what I normally add to webpages:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:like href="http://hpsg.fu-berlin.de/OALI/" layout="button_count" width="90" show_faces="true"></fb:like>

But OMP just deletes <fb:..></fb:like>

Is there another way to do this?

Similarly for google+.

Thanks

Stefan
stefan
 
Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

Re: Adding face book button to the footer, code disappears

Postby asmecher » Fri Jan 24, 2014 1:54 pm

Hi Stefan,

Into which field specifically are you entering the footer code?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm

Re: Adding face book button to the footer, code disappears

Postby stefan » Fri Jan 24, 2014 2:22 pm

Hi,

Website|Press Page Footer

Best

Stefan
stefan
 
Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

Re: Adding face book button to the footer, code disappears

Postby asmecher » Fri Jan 24, 2014 3:07 pm

Hi Stefan,

Looks like the TinyMCE editor is likely to blame; see http://stackoverflow.com/questions/7744769/tiny-mce-stripping-out-facebook-tags?rq=1. You'll need to add the suggested configuration to plugins/generic/tinymce/TinyMCEPlugin.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm

Re: Adding face book button to the footer, code disappears

Postby stefan » Sat Jan 25, 2014 1:39 am

Hi Alec,

Thanks! I added

extended_valid_elements: "fb:like[href|layout|width|show_faces],g:plusone[size],a[href|target|download|rel|hreflang|type|class|rev|style]"

and now google:plus, fb and flattr work!

If somebody reads this and finds it useful, he or she may try the flattr button at the buttom of the following page =;-).

http://langsci-press.org

Best

Stefan
stefan
 
Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

Re: Adding face book button to the footer, code disappears

Postby stefan » Sun Jan 26, 2014 1:07 am

Hm, this is mysterious. I had everything working. Then I changed the URL for the thing to be flattred and this broke everything since the href-tag of the flattr link was removed. I was able to enter the stuff in a way that I cannot recapitulate.

Entering this code took me several hours and due to the removed href, I lost all the facebook followers. Is there a way to circumvent this HTML editor? Is there a way to enter HTML directly into the database?

Thanks a lot!

Stefan
stefan
 
Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

Re: Adding face book button to the footer, code disappears

Postby asmecher » Mon Jan 27, 2014 6:32 am

Hi Stefan,

Sorry about the lost code -- that sounds frustrating. You can disable the HTML editor for specific fields by finding where the fields exist in the Smarty templates. In the case of the footer template, it'll be templates/controllers/tab/settings/appearance/form/appearanceForm.tpl; you can find the specific control by looking for "footer" or similar. The field itself will look like this:
Code: Select all
{fbvElement type="textarea" multilingual=true name="pressPageFooter" id="pressPageFooter" value=$pressPageFooter rich=true}
Removing the "rich=true" attribute will disable the TinyMCE editor for that field.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm


Return to OMP Technical Support

Who is online

Users browsing this forum: No registered users and 4 guests