Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

light responsive category menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-24-2015, 02:42 PM
  christindall's Avatar 
christindall christindall is offline
 

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

Default light responsive category menu

So on the Light Responsive template, when it is viewed on anything where the mobile_header is invoked, the shopping categories are dropped to the very bottom of the page, and there is no category drop down on the mobile header (which i would expect, as a user)

so, I've been playing with it a bunch - I can get it to work if I turn off fancy categories; but I want fancy categories (I have only a handful of categories for this site).

Is there a way to modify the categories.tpl (or .php file, even), so that I can use the non-fancy categories on the mobile_header menu, and use fancy categories on the desktop site? I've tried everything I can think of, and my eyes and brain are going buggy, so I figured I'd toss this out there.

ALSO - in the light responsive template, if you want your images to be responsive, you need to modify the product_thumbnail.tpl - I made the image width into max-width, and before that I placed a width="100%" - which means that it will go to 100%, but not larger than the defined size.
__________________
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
  #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

The following 2 users thank christindall for this useful post:
qualiteam (05-24-2015), TexasFood (05-26-2018)
  #3  
Old 12-08-2015, 12:36 PM
 
macak49 macak49 is offline
 

Newbie
  
Join Date: Aug 2013
Posts: 9
 

Default Re: light responsive category menu

To add scrolling to the pop up category menu you can also add this to your changes. This works for if you have a ton of categories, like I do.

To the bottom of mobile_categories.tpl add a new class to the ul, I added "mobile-menu-d" as my new class.

Code:
<ul class="mobile-menu-d"> {$smarty.capture.menu} </ul>


Then in altskin.css add the following under "@media screen and (max-width933px)" somewhere around line #3230 of altskin.css.

Code:
.mobile-menu-d{ max-height: 400px; overflow-y: scroll; overflow-x: hidden; }

The height is editable to taste, I found 400px to be a decent height on my phone but it may change later. It works with touch scrolling on iPhone and Android for what I can tell, but I have not tested it on a huge range of devices.
__________________
Xcart Gold 4.7.4
Reply With Quote
  #4  
Old 05-11-2016, 09:13 AM
 
welly welly is offline
 

eXpert
  
Join Date: Mar 2011
Location: UK
Posts: 209
 

Default Re: light responsive category menu

I've just started working on this template and I agree about the position of the categories list in mobile view, but can you elaborate a little on your comment at the start of the thread regarding responsive images please Chris?

Quote:
Originally Posted by christindall
ALSO - in the light responsive template, if you want your images to be responsive, you need to modify the product_thumbnail.tpl - I made the image width into max-width, and before that I placed a width="100%" - which means that it will go to 100%, but not larger than the defined size.

I don't understand what is needed.

Many thanks

Welly
__________________
X-Cart Business 5.3.6
Various add-ons

www.traininglines.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:42 AM.

   

 
X-Cart forums © 2001-2020