Support » Plugins and Hacks » [Resolved] Select All / Deselect All

[Resolved] Select All / Deselect All

  • First of all…. awesome plugin!

    I know that new features will come when you time allows it, but i have a small problem! I’m doing a website with galleries with a lot of pictures, 30+, and in terms of usability, its a pain when you hit the ‘Select All’ button, and then you try to deselect most of them… it seems a small issue, but it happens. Is it possible to include a deselect all button?

    Thanks! 🙂


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author webaware


    I won’t be adding a deselect, but it is easy for you to add one yourself.

    • create a folder ‘nggallery’ in your theme’s folder
    • copy the download template from the templates folder in the plugin into that new folder
    • duplicate the line with the selectall button and change ‘ngg-download-selectall’ to ‘ngg-download-selectnone’
    • add the following code to the block of jQuery code:
    $("input.ngg-download-selectnone").show().click(function() {
        $(this).closest("form").find("input[name='pid[]']").prop({checked: false});


    Awesome help Ross.
    I’ve tried already and works just fine!


    Plugin Author webaware



    Thank you for this!
    I did it in my own way, creating one button with Select/Deselect and adding this code

    var $selected = 0;
    <?php /* reveal "select all" button and active it */ ?>
    	$("input.ngg-download-selectall").show().click(function() {
    		if ($selected == 0) {
    			$(this.form).find("input[name='pid[]']").prop({checked: true});
    			$selected = 1;
    		} else {
    			$(this).closest("form").find("input[name='pid[]']").prop({checked: false});
    			$selected = 0;

    I’m sure there’s a more elegant way of doing this, but this was the most simple.

    By the way, why is not all buttons linked to the language files? I can’t, for instance, find the select all text in the po-file.

    Plugin Author webaware


    G’day Marcus,

    I recently added the “select all” text to the .po files (oops!) so the next release will have that. Of course, the text might be a bit funny because I used Google Translate to do it 🙂 but at least it won’t be English for every language. Translation fixes are always welcome!


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Select All / Deselect All’ is closed to new replies.