View Single Post
  #2  
Old 05-24-2015, 08:16 PM
  christindall's Avatar 
christindall christindall is offline
 

eXpert
  
Join Date: Dec 2007
Location: Everett, WA
Posts: 264
 

Default Re: light responsive category menu

Ok - so, figured it out. If anybody else cares, here's what I did:

First, I created a new file in light_responsive -> customer and named it mobile_categories.tpl

The contents of the file look like this:

Code:
{if $categories_menu_list ne '' or $fancy_use_cache} {capture name=menu} {foreach from=$categories_menu_list item=c name=categories} <li{interline name=categories foreach_iteration="`$smarty.foreach.categories.iteration`" foreach_total="`$smarty.foreach.categories.total`"}><a href="home.php?cat={$c.categoryid}" title="{$c.category|escape}">{$c.category|amp}</a></li> {/foreach} {assign var="additional_class" value="menu-categories-list-simple"} {/capture} <ul> {$smarty.capture.menu} </ul> {/if}


Then, in mobile_header.tpl, I added the following code immediately after the first ul:

Code:
<li class="dropdown"> <a id="main-menu-toggle" class="dropdown-toggle" href="#"> <span class="fa fa-th-list"></span> </a> <div id="categories-menu-box" class="dropdown-menu"> {include file="customer/mobile_categories.tpl"} </div> </li>

the span class fa-th-list - I chose that because I liked that it was similar but different to the "list" icon - you can see an entire list of options at http://astronautweb.co/snippet/font-awesome/ - the file that references that class is in skin -> common_files -> css -> font-awesome.min.css


I think that's it. when you "shrink" your desktop screen, or look at it on a phone screen, you'll see the extra dropdown nav full of categories. Now, my site doesn't have that many root categories - I have NO clue how this will work if you have tons of root categories (although I'll know in a few weeks when I upgrade my main site to 4.7.2, as I have like 100 root categories on that site...)
__________________
Chris Tindall
x-cart 4.7.5 Gold Plus
www.theweedpatchstore.com
AlteredCart: On-Sale, One Page Checkout, Checkout One Payments (although that's not working yet)
BCSE: Back in stock Notify, Checkbox Radio Mod, Upselling Links
SMACK: CDSEO Pro, Product Map
X-Cart: Gold+, Mobile
(still trying to get working: Gahela Support Suite)
Reply With Quote