Page 1 of 1

Force single layer category view for mobiles

Posted: Tue Jun 11, 2013 12:16 pm
by Martin
Having just created a huge tree of categories and sub-categories as part of an accordion type overhaul of my site I realised that mobile phone users get swamped in their view so I've come up with a small mod' that fixes their view to just one level of categories. It does required them to click to reach the next levels but reduces the scrolling to a minimum.

Open: /includes/display/SideCategoryList.php

Find:

Code: Select all

$GLOBALS['SubCategoryList'] = $this->_getSubCategory($categories, $rootCat['categoryid']);
Replace with:

Code: Select all

//$GLOBALS['SubCategoryList'] = $this->_getSubCategory($categories, $rootCat['categoryid']);
				
				if($GLOBALS['ISC_CLASS_TEMPLATE']->getIsMobileDevice()) {
					$GLOBALS['SubCategoryList'] = '';
				}
				else {
					$GLOBALS['SubCategoryList'] = $this->_getSubCategory($categories, $rootCat['categoryid']);
				}