Categories not selected are shown

Hello good people!

First of all thank you for making this great extension free! I really enjoy it.

I'm sorry if I do some mistakes, English isn't my native language.

When I select some child-categories they show another categories also!

Mi categories are

Obras Sociales (1 Active / 0 Trashed) default Public All 1
. |_ Normativas (4 Active / 0 Trashed) default Public All 7
. |_ Normativas Especiales (3 Active / 0 Trashed) default Public All 8
. |_ Carátulas (1 Active / 0 Trashed) default Public All 9
Presidencia (3 Active / 0 Trashed) default Public All 2
Informacion General (1 Active / 0 Trashed) default Public All 3
Asuntos Profesionales (0 Active / 0 Trashed) default Public All 4
. |_ Informativo ANMAT (0 Active / 0 Trashed) default Public All 10
. |_ Residuos Patógenos (0 Active / 0 Trashed) default Public All 11
. |_ Inspeción de Farmacias (1 Active / 0 Trashed) default Public All 12
. |_ Seguro Mala Praxis (0 Active / 0 Trashed) default Public All 13
Capacitaciones y Eventos (4 Active / 0 Trashed) default Public All 5
Descargas (0 Active / 0 Trashed) default Public All 6
. |_ Vademecum (1 Active / 0 Trashed) default Public All 14
. |_ Carátulas (0 Active / 0 Trashed) default Public All 15
. |_ Padrones (1 Active / 0 Trashed) default Public All 16
. |_ Formularios (0 Active / 0 Trashed)


A setting

Source Retrieve items from categories


Another setting

Filter Category all (off) / select (on)



The selected Categories are

Obras Sociales (parent category)
Normativa (child category)
Normativas Especiales(child category)
Carátulas (child category)


And the front-end is

Filtered by All Carátulas Normativas Especiales Normativas Presidencia Capacitaciones y Eventos

And I don't know why "Presidencia" and "capacitaciones" are shown.

I do a copy-paste of the PORTFOLIO subtemplate, and call it MINIMALIST. The ONLY change that I did was in the default.php -> FOLIO CONTAINER. But i didn't touch the
"div id=filter"

Anyway the problem was before the new subtemplate.

So maybe is a JS problem? Or the others minik2 in the home?

In the site details I leave a user and a pass.

All the categories was created via k2.

Cheers and I will waiting for your help.
8 years 9 months ago #1 by Cristian

Please Log in or Create an account to join the conversation.

  • Posted by TemplatePlazza (5310) Offline
Hi, Can you try to publish only one minik2 module and see whether the issue persists or not?
8 years 9 months ago #2 by TemplatePlazza

Please Log in or Create an account to join the conversation.

Yes!! I delete (sent to the paper bin) the other modules, and it show the right items in the filter.

I think the problem was because I copy-paste the module and use the same filter, but when I create a new Mini k2 Module the error occurs again.

Should I modify the script.js? ( modules\mod_minik2\tmpl\TEMPLATENAME\assets\script.js )
Creating a FOR loop or something, modificating the word "FILTER" to "FILTER[0]" from the 53 line to the final?
8 years 9 months ago #3 by Cristian

Please Log in or Create an account to join the conversation.

  • Posted by TemplatePlazza (5310) Offline
Hi, yes it's probably because of js conflict. Try to rename all classes name in the default file . For example
<div id="filter"></div>
 
<div id="folio-container">
 
    <ul id="stage">

to
<div id="filter2"></div>
 
<div id="folio-container2">
 
    <ul id="stage2">

then change all the class names in the script.js as well
8 years 9 months ago #4 by TemplatePlazza

Please Log in or Create an account to join the conversation.

Thanks for your answer, I modify the default.php and the script.js and the issue continues.

The script.js with the modification is
jQuery.noConflict();
 
jQuery(document).ready(function(){
	var items = jQuery('#stage2 li'),
		itemsByTags = {};
 
	// Looping though all the li items:
	items.each(function(i){
		var elem = jQuery(this),
			tags = elem.data('type').split(',');
 
 
		// Adding a data-id attribute. Required by the Quicksand plugin:
		elem.attr('data-id',i);
		jQuery.each(tags,function(key,value){
 
			// Removing extra whitespace:
			value = jQuery.trim(value);
 
			if(!(value in itemsByTags)){
				// Create an empty array to hold this item:
				itemsByTags[value] = [];
			}
 
			// Each item is added to one array per tag:
			itemsByTags[value].push(elem);
		});
 
	});
 
 
	// Creating the "Everything" option in the menu:
    var filtertext = jQuery('<span>'+WORD_FILTER_BY+'</span>').appendTo('#filter2');
	createList(WORD_EVERYTHING,items);
 
	// Looping though the arrays in itemsByTags:
	jQuery.each(itemsByTags,function(k,v){
		createList(k,v);
	});
 
	jQuery('#filter2 a').live('click',function(e){
		var link = jQuery(this);
 
		link.addClass('active').siblings().removeClass('active');
 
		// Using the Quicksand plugin to animate the li items.
		// It uses data('list') defined by our createList function:
 
		jQuery('#stage2').quicksand(link.data('list').find('li'));
		e.preventDefault();
	});
 
	jQuery('#filter a:first').click();
 
	function createList(text,items){
 
		// This is a helper function that takes the
		// text of a menu button and array of li items
 
		// Creating an empty unordered list:
		var ul = jQuery('<ul>',{'class':'hidden'});
 
		jQuery.each(items,function(){
			// Creating a copy of each li item
			// and adding it to the list:
 
			jQuery(this).clone().appendTo(ul);
		});
 
		ul.appendTo('#portfolio-container2');
 
		// Creating a menu item. The unordered list is added
		// as a data parameter (available via .data('list'):
 
		var a = jQuery('<a>',{
			html: text,
			href:'#',
			data: {list:ul}
		}).appendTo('#filter2');
	}
});

I think I modified right.
8 years 9 months ago #5 by Cristian

Please Log in or Create an account to join the conversation.

  • Posted by TemplatePlazza (5310) Offline
Hi,
jQuery('#filter a:first').click();
at lines 53 is not changed yet to #filter2
8 years 9 months ago #6 by TemplatePlazza

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum