Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Is there a way to set announcement in the category by default.

Is there a way to set announcement in the category by default for roles who are allowed to announce?

Thanks!

Comments

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭
    edited August 2015

    How should announcements look like?
    Look at Bump plugin to move a discussion to the top.
    Look at PrefixDiscussion to mark it in a specific visible way.
    Both have permissions you can assign to specific roles.

  • myemye New
    edited August 2015

    Just standard way. Want to make it enabled by default in new post dialog. see attachment.

  • peregrineperegrine MVP
    edited August 2015

    make a plugin load the script only on new discussion page.

    add this function to a basic plugin you create

    public function PostController_Render_Before($Sender) {
    
    if (Gdn::Session()->CheckPermission('Vanilla.Discussions.Announce')) {
    $Sender->AddJsFile('ann-cat.js', 'plugins/nameofyourplugin');
    }
    }
    

    add this file to js folder in your plugin

    you could try jquery

        jQuery(document).ready(function($) {
        `$('#Form_Announce1').prop('checked',true);`
        });
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • this will restrict to new discussions (and not edit).

    $('#vanilla_post_discussion #Form_Announce1').prop('checked',true);

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.