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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
stefan
Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

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

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

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

stefan
Posts: 81
Joined: Wed Feb 06, 2013 1:49 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

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

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

stefan
Posts: 81
Joined: Wed Feb 06, 2013 1:49 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

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

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


Return to “OMP Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest