Social Sharing Buttons

Plugin Development

Suggested Topics

  • 0 Votes
    2 Posts

    @Thadeusz-Lay don't think there are hooks to do that. You can accomplish it by adding some js and css in ACP -> Appearance -> Custom HTML & CSS.

    Here is an example. You will need to add code to handle what needs to happen on clicking the button.

    Custom Header:

    <script type="text/javascript"> $(document).ready(function() { $(window).on('action:ajaxify.end', function(ev, data) { $('[component="account/cover"] .avatar-wrapper').append('<button class="btn-new"><i class="fa fa-plus"></i></button>'); }); }); </script>

    Custom CSS:

    .avatar-wrapper .btn-new { height: 2em; width: 2em; line-height: 2em; border-radius: 50%; border: none; background: #F44336; color: #fff; overflow: hidden; top: 93px; left: 4px; position: absolute; }
  • 0 Votes
    3 Posts

    @baris Just tried out 3.0.27, works great, thanks! There's still one difference: with filter:composer.formatting the text is run through the translator automagically, but with composer.addButton() I have to translate it first. Not a big deal, just pointing that out...

  • Social Share Callback

    Unsolved Plugin Development
    0 Votes
    8 Posts

    @PitaJ I think their JS SDK support, i tried googling. They have the share function with response id as callback. We can check for the response id to check if the content is actually shared.

  • 0 Votes
    4 Posts

    The loop to add buttons was merged into persona. A similar addition should probably be added to vanilla.

    I now add buttons in my plugin via hook filter:post.getPosts and in the hook:

    Plugin.postsBuild = function(params, cb) { var histButton = {action: 'posts/edithistory', icon: 'fa-file-text', html: 'Edit History'};, function(post, next) { if(!post) return next(); if(!! { = []; }; }); cb(null, params); };
  • 0 Votes
    8 Posts

    I've used hook method in my bbcode plugin (watch Extension block here -
    It is greate since:

    If there is no 'parent' plugin there will be no errors (noone call the hook) Plugin priority dosn't matter because hooks should be called after all plugins are loaded