Re: CSS Dropdown menu for the header- With Categories!
Quote:
Originally Posted by
gmerdan
I've tried to search the 200 pages of this thread with no luck.
Instead if displaying "Home, Categories, Information, Contact us, etc" in the horizontal bar. Is it possible to replace these with main categories and the drop down shows sub-categories? Dynamically loading the categories and sub-categories, not adding in manually.
It would look like:
Category 1 | Category 2 | Category 3
|>subcat
|>subcat
Hopefully, a someone can help answer this, and Ive tried include keywords to help others who are trying to search the same thing.
Replace header css flyout with categories and sub categories
Thanks in advance!
Whew...found an answer on page 172.
Replace categories_ul_generator.php with:
Had to modify it for my purpose, but this solved my first question. THANKS GUYS!
Code:
<?php
class zen_categories_ul_generator {
var $root_category_id = 0,
$max_level = 6,
$data = array(),
$root_start_string = '',
$root_end_string = '',
$parent_start_string = '',
$parent_end_string = '',
$parent_group_start_string = '<ul%s>',
$parent_group_end_string = '</ul>',
$child_start_string = '<li%s>',
$child_end_string = '</li>',
$spacer_string = '
',
$spacer_multiplier = 1;
var $document_types_list = ' (3) ';// acceptable format example: ' (3, 4, 9, 22, 18) '
function zen_categories_ul_generator($load_from_database = true)
{
global $languages_id, $db;
$this->data = array();
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_id = cd.categories_id
and c.categories_status=1 " .
" and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
" order by c.parent_id, c.sort_order, cd.categories_name";
$categories = $db->Execute($categories_query);
while (!$categories->EOF) {
$this->data[$categories->fields['parent_id']][$categories->fields['categories_id']] = array('name' => $categories->fields['categories_name'], 'count' => 0);
$categories->MoveNext();
}
}
function buildBranch($parent_id, $level = 1, $submenu=false) {
if ($parent_id != '0') {
$result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level) . '"' : '' );
}
if (($this->data[$parent_id])) {
foreach($this->data[$parent_id] as $category_id => $category) {
$category_link = $category_id;
if (($this->data[$category_id])) {
$result .= sprintf($this->child_start_string, ($submenu==true) ? ' class="submenu"' : '');
} else {
if (($this->data[$category_id]) && ($submenu==false)) {
$result .= sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '');
$result .= sprintf($this->child_start_string, ($submenu==true) ? ' class="submenu"' : '');
} else {
$result .= sprintf($this->child_start_string, '');
}
}
if ($level == 0) {
$result .= $this->root_start_string;
}
$result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">';
$result .= $category['name'];
$result .= '</a>';
if ($level == 0) {
$result .= $this->root_end_string;
}
if (($this->data[$category_id])) {
$result .= $this->parent_end_string;
}
if (($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
$result .= $this->buildBranch($category_id, $level+1, $submenu);
}
$result .= $this->child_end_string;
}
}
if ($level > 0) {
$result .= $this->parent_group_end_string;
}
return $result;
}
function buildTree($submenu=false)
{
return $this->buildBranch($this->root_category_id, '', $submenu);
}
}
?>
Re: CSS Dropdown menu for the header- With Categories!
Another question,
Is it possible to have all subcategories show up in 3 columns?
Example:
Category 1 | Category 2 | Category 3
------------------------------------------------------------
|>Cat1Sub1 |>Cat1Sub5 |>Cat1Sub9
|>Cat1Sub2 |>Cat1Sub6 |>Cat1Sub10
|>Cat1Sub3 |>Cat1Sub7 |>Cat1Sub11
|>Cat1Sub4 |>Cat1Sub8 |>Cat1Sub12
Re: CSS Dropdown menu for the header- With Categories!
Quote:
Originally Posted by
gmerdan
Another question,
Is it possible to have all subcategories show up in 3 columns?
Example:
Category 1 | Category 2 | Category 3
------------------------------------------------------------
|>Cat1Sub1 |>Cat1Sub5 |>Cat1Sub9
|>Cat1Sub2 |>Cat1Sub6 |>Cat1Sub10
|>Cat1Sub3 |>Cat1Sub7 |>Cat1Sub11
|>Cat1Sub4 |>Cat1Sub8 |>Cat1Sub12
You can do that the way i did mine. A little css and product tweaking.
Example
Just go into the header menu, top right and let me know if thats what you mean.
Re: CSS Dropdown menu for the header- With Categories!
Hi,
Please can someone help:cry:...the drop down menu is not working correctly in IE7... see here
As you will be able to see in IE 7(works fine in firefox) the drop down menus are not right. When you roll over the first link the first drop down doesn't fall below the horizontal links but on top and then the same things happens with the other drop down boxes, they cover the top links.
How can we correct this? Any help would be great...
Thanks
Re: CSS Dropdown menu for the header- With Categories!
Quote:
Originally Posted by
pb4
Hi,
Please can someone help:cry:...the drop down menu is not working correctly in IE7... s
ee here
As you will be able to see in IE 7(works fine in firefox) the drop down menus are not right. When you roll over the first link the first drop down doesn't fall below the horizontal links but on top and then the same things happens with the other drop down boxes, they cover the top links.
How can we correct this? Any help would be great...
Thanks
You'll need to find the correct 'top' command for that menu, but i'm pretty sure its:
div#dropMenu ul.level2
and add:
div#dropMenu ul.level2 {
top:25px;
}
and adjust the 'px' to suit.
Re: CSS Dropdown menu for the header- With Categories!
Quote:
Originally Posted by
first trading
You'll need to find the correct 'top' command for that menu, but i'm pretty sure its:
div#dropMenu ul.level2
and add:
div#dropMenu ul.level2 {
top:25px;
}
and adjust the 'px' to suit.
:clap: Thank you...that has sorted that issue :smile:
Re: CSS Dropdown menu for the header- With Categories!
Just a couple of questions..
Here's the site Im currently working on http://redscarfunion.ca/store/
1. If I want to hit the "home" button I end up getting the dropdown menu instead and a little box to the right which is the link to the home button.
Is there a way to ensure the dropdown menus dont overlap the main menu buttons?
2. I am now faced with the zen cart logo being back.. where do I change this.. I cannot figure it out..
3. I had at one point my sidebox (wide) with my ssl, paypal, facebook and twitter icons.. now when I do them the are outside of the white area..instead of inside
Hoping what I've asked makes sense
Re: CSS Dropdown menu for the header- With Categories!
Everything looks perfect to me, have you sorted this out...?
Re: CSS Dropdown menu for the header- With Categories!
No its not sorted..
I've included an image for you to look at ..
When I installed this menu..it bumped out my header and icons..
http://i636.photobucket.com/albums/u...embers/zen.jpg
Re: CSS Dropdown menu for the header- With Categories!
Quote:
Originally Posted by
JuzJoJo
Post #1925, this answers your question and fixes the problem you are having.