muskokee Posted March 16, 2006 Posted March 16, 2006 Hello, I have been fiddling with the css categories contrib to see if I can change the css display. I have looked for a contrib to do what I want but it is not out there...so I am going to try to create it with a little help from the community(cross my fingers ;) ). What the contribution is displaying now is one look for categories with subcategories and another look for categories with no subcategories. Although this is nice, I want to be able to control the look of each nested level using css, regardless of whether it has subcategories or not. So I am looking towards basing the display conditions on what integer the parent id has. My php skills are coming along but are not quite up to snuff. I found this function in general.php that is close to what I need but I am not sure how to modify it to isolate the parent id and create an array. function tep_get_parent_categories(&$categories, $categories_id) { $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$categories_id . "'"); while ($parent_categories = tep_db_fetch_array($parent_categories_query)) { if ($parent_categories['parent_id'] == 0) return true; $categories[sizeof($categories)] = $parent_categories['parent_id']; if ($parent_categories['parent_id'] != $categories_id) { tep_get_parent_categories($categories, $parent_categories['parent_id']); } } } right now it is set up to gather all parent category ids. How would I change this to gather all parent ids? Any help much appreciated. Sheri P.S. If using parent id's as a condition is not the best route, I would love any other suggestions. Quote
muskokee Posted March 17, 2006 Author Posted March 17, 2006 Any help much appreciated.Sheri P.S. If using parent id's as a condition is not the best route, I would love any other suggestions. No one?? Possibly new questions then :blush: HOW in the world does this cart come up with category_id numbers? they seem to make absolutely no sense, in terms of nesting. If I insert more columns into the categories table will that mess up the admin side of the category tree? Can I manually change parent_id's for my categories? Will that be a great big wrench in the mix? Thanks again Sheri Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.