Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Custom Taxonomy 'show all' checkbox

Viewing 5 posts - 1 through 5 (of 5 total)
  • Nick Bax
    #164552

    I have a list of terms from a custom taxonomy, with sub-cateogires listed underneath these as a checkbox. eg

    Cats []
    – Nice Cats []
    – Mean Cats []
    Dogs []
    – Big Dogs []
    – Little Dogs []

    I have stripped out the checkbox from the parent categories (‘Cats’, ‘Dogs’) and turned these into accordion drawers, so what I would like to do is have an ‘All <Parent cat name>’ option at the top of each subcat list like this.

    Cats
    – All Cats []
    – Nice Cats []
    – Mean Cats []
    Dogs
    – All Dogs []
    – Big Dogs []
    – Little Dogs []

    I do not see an option to achieve this anywhere and wondered if someone could point me in the right direction.

    Trevor Moderator
    #164572

    Do you have the Include Children in Parents option checked (ON)?

    Nick Bax
    #164800

    I do, but I have found a solution using jQuery. I cloned the parent categories, and moved them into the .children list, wrapped them in a <li>, and prepended them with ‘All ‘ 🙂

    jQuery('.sf-level-0').each(function() {
    
    	jQuery(this).find('.sf-label-checkbox:first').clone().prependTo(jQuery(this).find('.children'));
    
    	jQuery(this).find('.sf-input-checkbox:first').prependTo(jQuery(this).find('.children'));
    
    	jQuery(this).find(".children .sf-input-checkbox:first").next().andSelf().wrapAll('<li>').prepend('All ');
    	
    });
    Trevor Moderator
    #164803

    Cool. Am I OK to close this thread?

    Nick Bax
    #164805

    Yes. Thanks.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Custom Taxonomy 'show all' checkbox’ is closed to new replies.