Social Sharing Buttons

Plugin Development

Suggested Topics


  • 0 Votes
    2 Posts
    1k Views

    @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
    1k Views

    @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
    4k Views

    @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
    3k Views

    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'}; async.map(params.posts, function(post, next) { if(!post) return next(); if(!!post.tools) { post.tools = []; } post.tools.push(histButton); }); cb(null, params); };
  • 0 Votes
    8 Posts
    3k Views

    I've used hook method in my bbcode plugin (watch Extension block here - http://forum.apxeolog.com/topic/8/nodebb-bbcode-plugin)
    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