X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Alphabetical Dropdown Menu (https://forum.x-cart.com/showthread.php?t=49755)

cowsdonthack 09-18-2009 05:26 AM

Alphabetical Dropdown Menu
 
This one is simple to explain, not sure if it's simple to fix.

CSS
Code:

#all_products {
    width:400px;
}
.category_link {
    position:relative;
    float:left;
    width:200px;


PHP
Code:

<a href="#" class="all_products" onmouseover="document.getElementById('all_products').style.display='block';" onmouseout="document.getElementById('all_products').style.display='none';"><span>All Products&nbsp;</span></a>
                    {foreach from=$topmenu_items key=toppos item=topcat}
                        {if $topcat.id ne 0}
                            <a id="topmenutab{$topcat.id}" href="home.php?cat={$topcat.id}" onmouseover="showTopMenu({$topcat.id})" onmouseout="hideTopMenu({$topcat.id})"><span>{$topcat.name}&nbsp;</span></a>
                        {/if}
                    {/foreach}


DER GIVENS
What we have here is a Navigation Menu, you mouse over it, it drops down a menu.

What happens is it loads each category as a Link Text. CSS says that each Link Text is 200px wide.

SO.

If the CSS says the entire block is 400px wide. Then it has two Link Texts and then moves to the next line.

It looks like there are two columns. No one can tell.

IE if the CSS says the entire block is 600px wide, then it has three Link Texts and then moves to the next line.

DER PROBLEM
My boss wants it to go alphabetical straight down for each column. :(

Unfortunately, if I remove the width, it just goes straight down. If I limit the height in CSS then it goes and stops at the height and doesn't create a new line.

He doesn't want to rearrange the categories so that they come out alphabetical.

Yeah I know the problem is pretty laughable.

What I need I guess is a way to "Continue" a Column after the first one.
Or
Is there a way to load a certain number in the array (foreach) to be 1 - 10 and then load them in separate columns. So if there were 24 link texts, I could load 1 - 10 in one and 11 - 20 in another and 21 - 24 in the last one.

I'm open to suggestion

cowsdonthack 09-21-2009 05:05 AM

Re: Alphabetical Dropdown Menu
 
Bump a day

JWait 09-28-2009 05:17 AM

Re: Alphabetical Dropdown Menu
 
Der Solution
Get a new boss. :)

I guess you could "total all the categories" then divide by the "number of columns" and then use a "loop the number of columns" and display each category that way, but it would be some really involved code.

cowsdonthack 09-28-2009 05:27 AM

Re: Alphabetical Dropdown Menu
 
Quote:

Originally Posted by JWait
Der Solution
Get a new boss. :)


jWait,

IT WORKED! Thanks a lot, this also fixed over 9000 other problems that I was having with the site

Thank you very much! xD

PhilJ 09-28-2009 07:01 AM

Re: Alphabetical Dropdown Menu
 
http://forum.x-cart.com/showthread.php?t=26561


All times are GMT -8. The time now is 11:31 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.