Joomla: how to display sub-menu items - joomla

I created a website using Joomla! 3.4.1. It has some categories and the main menu looks like this:
Home
Main Category
Category 1
Category 1.1
Category 1.1.1
Category 1.1.2
Category 1.1.3
Category 1.2
Category 1.3
Category 2
Category 2.1
Category 2.2
I decided (I'm not sure if it was the best decision) to create the complete website structure in the main menu.
Now, in the "Category 1" page, I would like to have a menu showing some selected sub-menu items, for example:
Category 1 Menu:
Category 1.1
Category 1.3
In order to achieve this, I decided to create a new menu called "Category 1 Menu" with menu item aliases (to avoid creating new URLs).
Until now everything was ok, the problem is now I want to display Category 1.1 sub-items, but I just want to display the children of Category 1.1 when Category 1.1 is selected. Something like this:
Category 1
Category 1.1
Category 1.3
And if I click on "Category 1.1" its items should expand like this:
Category 1
Category 1.1
Category 1.1.1
Category 1.1.2
Category 1.1.3
Category 1.3
Remember, all these items are menu item aliases.
I know how to do it without usign menu item aliases but in this case, I think that I need to use menu item aliases, otherwise I won't have a complete "tree" structure in the breadcrumbs.
What can I do?
Thanks in advance!

if you don't wanna use aliases you can easily create a module or search for one in JED. Basically code for sub menu is like this:
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$childs = $menu->getItems('parent_id', $active->id);
//now if childs are empty yoy don't have a submenu
if( !empty($childs) )
{
//show menu using foreach $childs as $child and creating friendly url using JRoute
}

Related

List Categories and articles in Joomla

I'm trying to build a site with multiple categories and sub-categories in Joomla. The structure looks like this:
category 1
category 2
- category 3
- category 4
category 5
- category 6
- category 7
...
Each category has some articles.
What I want to do is create a navigation menu from these categories, so category 1,2,5 become top level links in the menu, while 3,4,6,7 become sub links in the corresponding dropdown list. (Update)And the articles under a category become sub links after the categories.
I've tried a few options:
Module Articles Category: It lays out all articles in a flat list without categories, not good
Module Articles Categories: It lays out all the sub-categories, but no articles
Menu item - List all categories: It gives the right result, but in a page accessed by clicking that menu item.
Menu item - single article: It's totally static and time consuming.
I'm wondering if there's a way of generating an ordinary normal navigation menu, like the ones you see in Amazon or ebay?
Why don't you create a menu structure that is similar to your category structure. So:
Menu 1 corresponds to category 1
Menu 2 corresponds to category 2
Menu 2.1 etc
You can then link each menu item through a category blog type menu item to the appropriate category. You can then configure how the articles should be displayed (multi-column, intro etc).

Joomla menu and K2 categories. How do I

I am using Joomla 2.5 as CMS for my website, and I am using K2 for categories and articles/items. I was wondering if i have list of 50 - K2 categories.
It has 5 main categories and 10 sub categories for each.
How can I either manually or automatically make categories listed in main menu and when user clicks for example:
Home >> Contact >> Products >> About >> Call
If user selects Contact, how can I make it so it loads page which displays all articles/items in category called "Contact" but if User selects specific sub item from Contact for example:
Contact
^^Phone
^^Email
^^Skype
^^Post
if user selects Email it would show only articles/items from category Contact>>Email.
Help?
You can create a Menu item called Categories for example, or 10 menu items each one for your top categories.
Then you can start adding submenu items, for example in the top menu level called Contact add the Email sub-categorie. So when users visit your website can navigate through the menu to all categories you got.
An other way to do it faster is to use this plugin: http://www.nonumber.nl/extensions/addtomenu but I think it only works for items and not for categories (but you can ask the developer).
IMPORTANT: You can have top-categories configured to show only the items of this one or also with sub-categories, and can create a K2 menu item which can display in one link lot of categories you can choose in the parameters using CTRL+CLICK (even from other top categories).

Issue with Magento Categories

I am having issues arranging the categories in magento. The system has more than 3000 categories. There are 4 level categories which means: Parent>Level1>Level2>Level3>Level4.
All the products are sitting in level4 categories and level1,2 and 3 are just empty.
What I am trying to do is under level2 display its sub categories using a static block and then under level 3 display the categories from level 4.
2nd issue is I dont want to show all the categories in the main menu bar as loading 3000 categories will kill the server.
I want to do something similar to this: http://www.staples.ca/ENG/Catalog/cat_super.asp?catids=%2C&name=CA_SU_Office+Supplies
Here is the link for the site: bindersnink(dot)ca
From what I can see in the Staples link you added, they only show top level categories on their main menu nav bar. You can do this in your Magento store by simply changing a configuration value. Just login to your backend, go to System > Configuration and click on the Catalog > Catalog section in the left panel. On that page you will see a section called Category Top Navigation. Change the Maximal Depth to 1. This way only your top level categories will show up in the menu.
Just note that if you want all products in child categories to display on the top level category page, you will need to go to the edit category page, go to the Display Settings tab, and make sure that Is Anchor is set to yes.

Joomla main menu not showing all K2 Product Categories

I am using K2 component to showcase my products. I have created a menu item in my main menu for showing all my product categories (without sub categories) in a catalog style (To do this I went to- menu item> K2>Item Listing>Categories). I have created three product categories and six product items, but when I click on the menu I created it just shows only one category.
I want to display all the categories in a catalog style (No sub categories or items) when clicked on the menu. For example: http://demo.getk2.org/en/catalog
Would you please kindly tell me how to do this?
Thanks in Advance
You need to set the parameters for how K2 categories display in:
K2 > Categories > [Your Main Category] > Category View Options > Sub-category handling
(Change in the Parameters... you can also use the 'Inherit parameter options from category' to set other categories to follow the same format once you get it set up how you want)

Magento get the root category url

I'm a Magento newbie.
I've customized the top navigation bar and now is something like this:
HOME CATALOG CMS_LINK CMS_LINK CMS_LINK
For the HOME link and the CMS_LINK links all it's ok but I would when an user click on the CATALOG will see a page with all categories (subcategories of the root category) in a grid view with category i
As part of the category controller action Magento validates the category against the Mage_Catalog_Helper_Category function canShow().
This will return false against the check against isInRootCategoryList(). This function goes and checks the category's parent ids against the store root category id:
$rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
return in_array($rootCategoryId, $category->getParentIds());
The easiest solution that I can think of for your problem without changing core functionality would be to create a sub category of your root category named "Catalog" which would itself contain all the other categories. You can then set-up this category to not display products and only display a cms block.

Resources