-
Notifications
You must be signed in to change notification settings - Fork 44
Add custom share buttons
Thomas Kuther edited this page Feb 15, 2017
·
8 revisions
You may want to add share buttons for other services than "the big 3".
This is requested quite often, and can be achieved quite easily by creating a custom plugin that adds some jQuery code.
1.) Go to Administration -> Plugins -> Local Files Editor -> Personal Plugin
2.) Add this code:
<?php
add_event_handler('loc_end_picture', 'add_custom_share_buttons');
function add_custom_share_buttons() {
global $template;
//heredoc multiline, take care
$script_content = <<<EOT
$(document).ready(function() {
$('#theImageShareButtons>section').append('<a href="mailto:me@xy.net" title="Mail"><i class="fa fa-envelope"></a>');
})
EOT;
$template->block_footer_script(array('require' => 'jquery'), $script_content);
}
?>
The interesting part here is the <a href="mailto:me@xy.net" title="Mail"><i class="fa fa-envelope"></a>.
You can paste any HTML code here from any service. The <i class="fa fa-envelope">defines the icon to be shown.
See http://fontawesome.io/icons/ for a full list of all icons.
3.) Enable the Personal Plugin in Administration->Plugins
- Frequently Asked Questions
- Plugin Support Matrix
- Video support
- EXIF Metadata in PhotoSwipe
- Make it work like Smartpocket
- Add custom CSS and Javascript
- Override the Navbar style and background
- Compile your own Bootstrap
- Add primary links to the top navigation
- Add custom share buttons
- Hide image metadata by default
- Replace default mobile webapp logo icons
- Remove the "Mail to Webadmin" link in the footer
- Pre generate custom size derivatives