Post by eurorackworld » Wed Aug 09, 2017 7:09 pm

On my homepage: https://eurorackworld.com/ the number of columns always stay at 4 for the product overview (see the featured overview). If add a right column, the number of product columns stay at 4, so it becomes really cramped. On my category page it does work fine, see https://eurorackworld.com/eurorack-modules , with a right columns it shows now 3 products in a row, and when adding a right column it shows two. Why is this not working at the featured modules on the homepage?

I noticed that there is a 'dynamic' fix in the common.js but that only works for the category page. For the homepage somewhere the wrong id is added to the class , as 'product-layout col-lg-3 col-md-3 col-sm-6 col-xs-12' should be 'product-layout col-lg-4 col-md-3 col-sm-6 col-xs-12'

I checked out many files but no idea where the this part of the class is changed? Is there a location which works like the common.js for the category, which changes the number of columns based on the presence of the right or left columns? It should be an easy fix if I know where that homepage class is changed, anyone an idea?

Newbie

Posts

Joined
Tue Jun 27, 2017 11:30 pm

Post by inactiveaccount9912 » Wed Aug 09, 2017 10:38 pm

Try adding this to the bottom of common.js:

Code: Select all

$(document).ready(function () {
	var cols = $('#column-right, #column-left').length;

	if (cols == 2) {
		$('h3 + .row > .product-layout').attr('class', 'product-layout col-lg-6 col-md-6 col-sm-12 col-xs-12');
	} else if (cols == 1) {
		$('h3 + .row > .product-layout').attr('class', 'product-layout col-lg-4 col-md-4 col-sm-6 col-xs-12');
	} else {
		$('h3 + .row > .product-layout').attr('class', 'product-layout col-lg-3 col-md-3 col-sm-6 col-xs-12');
	}
});

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by eurorackworld » Wed Aug 09, 2017 10:48 pm

Thanks! that indeed works!

I added it within the other document.ready, just to keep it clean..

I did find the features.tpl now but when I changed that, still nothing happens, so weird.... No idea where that feature stuff comes from as I don't mind changing that, although that is within a template and might be overwritten.. Oh well saved for now, thanks!

Newbie

Posts

Joined
Tue Jun 27, 2017 11:30 pm

Post by inactiveaccount9912 » Wed Aug 09, 2017 10:52 pm

Yes, that's probably it, there could be a cached version of featured.tpl in the ocmod cache.(whenever tpl changes seem irrelevant try refreshing the ocmod cache)

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by eurorackworld » Wed Aug 09, 2017 11:07 pm

arghh crap , it is indeed the modification cache,cleared it (and rebuild it, maybe useles..:P), and it works now without the javascript change..

Newbie

Posts

Joined
Tue Jun 27, 2017 11:30 pm
Who is online

Users browsing this forum: No registered users and 141 guests