Page 1 of 1

Custom Category List Box

Posted: Mon Nov 08, 2010 11:19 am
by bart
Hi,

I am trying to create a custom category list and display it in a side panel. I have managed to create the list using a SQL query but i cant then get it to display using a modified template. I have tried using the SideShopByBrand and SideCategoryList html & php files but cant get my list to display. If someone could point me in the right direction that would be great.

I have also seen files called SideCustomCategoryList but i cant get these to to do anything, what are these used for?

Thanks
Bart

Re: Custom Category List Box

Posted: Tue Nov 16, 2010 10:37 pm
by karl800
Any joy on this, i would like the same thing, have a secondary Category list to show a list of sub cas per a main Cat..

Eg New items on one side menu and second hand items on another side menu.

Cheers
Karl

Re: Custom Category List Box

Posted: Fri Nov 19, 2010 4:45 pm
by bart
I haven't managed to get this working with a great method. I have done a very horrible fix by hacking the Brands section which involved a lot of editing in the front_language.ini file and makes for upgrade nastiness.
I have also customised some css and use the accordion menu to give the look of different menus.

have a look at my site too see what i mean if you like.
http://www.paradox-body-piercing-jewellery.com

Re: Custom Category List Box

Posted: Fri Nov 19, 2010 5:42 pm
by Tony Barnes
Nice implementation of the Category accordion :D

Re: Custom Category List Box

Posted: Fri Nov 19, 2010 6:52 pm
by bart
Thank you for the help.

Re: Custom Category List Box

Posted: Mon Nov 29, 2010 10:30 pm
by karl800
bart wrote:I haven't managed to get this working with a great method. I have done a very horrible fix by hacking the Brands section which involved a lot of editing in the front_language.ini file and makes for upgrade nastiness.
I have also customised some css and use the accordion menu to give the look of different menus.

have a look at my site too see what i mean if you like.
http://www.paradox-body-piercing-jewellery.com
Hi Bart,
I like how you got the Cat's like that, is still still the nasty hacky way.. This might work in a sense for what we are looking for.. Any chance of showing how you got the cats on the left display like that..

cheers

Re: Custom Category List Box

Posted: Tue Nov 30, 2010 2:04 pm
by bart
Hi,

I used Tony's menu code found in the Accordion Menu 2 section (viewtopic.php?f=12&t=117) with a few modifications.

Code: Select all

 <script type="text/javascript">

$(function() {
   $('#SideCategoryList ul ul').hide();
    $('#SideCategoryList ul li:first').css("border","2px solid #e3f2f5")
    $('#SideCategoryList ul li:first').css("background-color","#f4fafd")
    $('#SideCategoryList ul li:first').css("1padding","10px")
    $('#SideCategoryList ul li:first').css("margin","0px 0px 10px 0px")
    $('#SideCategoryList ul ul:first').show();
   $('#SideCategoryList li a').click(
   function() {
   if($(this).next().is('ul')) {
   $(this).next().slideToggle(400);
   return false;
   }
   }
   );
   var m = location.href;
   var n = m.substring(0,m.indexOf('?'));
   var q = n;
   var prodcheck = m.match("/products/");
   var catcheck = m.match("/categories/");
   if ((prodcheck !== null) || (catcheck !== null)) {
   if (n.length < 1) {
   q=m;
   }
   var p = $('#ProductBreadcrumb li:last').prev().html();
   if(p !== null){
   l = p.indexOf("=") + 2;
   r = p.indexOf(">") - 1;
   p = (p.substring(l, r));
   q=p;
   }
   $("a[href="+q+"]").parent().parent().parent().parent().show();
   $("a[href="+q+"]").parent().parent().show();
   $("a[href="+q+"]").not('.Content a').css("font-weight","bold");
   }
});

</script>   


I also needed to edit a template file for the css to work. This file is: Panels/SideCategoryList.html

The h2 tags are hidden because i didn't need the category title, also the "BlockContent" class needs removing.

Code: Select all

<div class="Block CategoryList Moveable Panel" id="SideCategoryList">
                    <!--<h2>%%LNG_ProductsByCategory%%</h2>-->
                    <div class="BlockContent-none">
                        <div class="%%GLOBAL_SideCategoryListTypeClass%%">
                            %%SNIPPET_SideCategoryList%%
                            <div class="afterSideCategoryList"></div>
                        </div>
                    </div>
                </div>
I think these are all the steps i needed to make, however you'll probably need to edit the styles to suit your site. if you have some problems or it just doesn't look right send me a message.

Re: Custom Category List Box

Posted: Tue Nov 30, 2010 8:32 pm
by karl800
Thanks will take a look at this, does this work on for version 5

Re: Custom Category List Box

Posted: Wed Dec 01, 2010 10:15 am
by bart
I'm using V6, however it should be ok in V5.