2022 Developer Survey is open! Take survey.

Hot answers tagged

16 votes
Accepted

How to create page only with modules and no component?

There isn't really a 'better way' than that. The only other option is to check whether you're on the homepage in your template file. To check if you're on the homepage you can use the method ...
user avatar
12 votes
Accepted

How to get the alias or title of the active menu item?

To get the data of the active (current) menu item, use the following code: $app = JFactory::getApplication(); // Access the Application Object $menu = $app->getMenu(); // Load the ...
user avatar
  • 19.5k
10 votes
Accepted

Understanding CSS classes applied to menus: "deeper" and "parent"

.deeper is applied when the menu item has a submenu (item) .parent is applied if this menu item is parent of another menu item If you have a menu showing all levels then both classes are applied to a ...
user avatar
  • 3,693
10 votes
Accepted

Custom menu get title of the active menu's parent item

Try this code: $menu = JFactory::getApplication()->getMenu(); $parent = $menu->getItem( $menu->getActive()->parent_id ); $parentname = $parent->title If you need the link $parentlink ...
user avatar
  • 225
9 votes
Accepted

Adding a numerical value to each submenu in Joomla

Instead of using and incrementing $num, replace that with $item->level. echo '<ul class="nav-child unstyled small lvl_'.$item->level.'">'; Note: Your code was missing a closing double quote ...
user avatar
9 votes
Accepted

Menu item without link

The main difference is how the HTML is rendered. Thus it depends on the template what the menu items look like. This is how the default Protostar template will display the different options: External ...
user avatar
  • 13.3k
7 votes

Copying Joomla Menu Items and keeping Module assignements

You can't do that as modules are assigned to a menu item id and saving a menu item as new will give it a new menu Id which no modules are assigned to. Moving an item will keep its id but not copying.
user avatar
7 votes
Accepted

How to make a menu item scroll to heading on same page?

When creating anchors, you need to assign the name as an ID of the element, like so: Link: <a href="#contact">Contact</a> Anchor: <div id="contact"> // Your form here </div&...
user avatar
  • 26.4k
7 votes
Accepted

How to add separate admin menu for custom component

We can develop an admin side component with the below code snippet. mod_custommenu.php $input = JFactory::getApplication()->input; $menu = new JAdminCSSMenu; $enabled = $input->getBool('...
user avatar
  • 2,651
6 votes

Creating a different kind of frontpage

This can be done with most templates. There's usually setting that lets you turn OFF the component function, hiding the main body. At that point it's just a page filled with modules. But even if you ...
user avatar
  • 2,366
6 votes

How to put divider images between menu items

You can achieve this using pure CSS using the greater than symbol > (immediate children selector) and the :after pseudo-element. Here's a quick example based on the default Joomla 3 and the ...
user avatar
  • 13.3k
6 votes
Accepted

Change "Show page heading" param for every menu item

I believe you'll need to use SQL statements such as below. But be CAREFUL - BACKUP THE TABLE FIRST to be sure that you can restore it if there are more considerations than you've realized at this ...
user avatar
  • 7,665
5 votes

How to create page only with modules and no component?

In the JED there's also a "blank" component that lets you publish a menu item so you can place only modules. http://extensions.joomla.org/extensions/style-a-design/personal-layout/17363
user avatar
  • 1,079
5 votes
Accepted

Generate menu structure from categories

There used to be a Joomla 1.5 era extension called Automatic Menu but I can't find it on the JED that did exactly this, so, I'm guessing it never made it off 1.5. However, in recent times we used a ...
user avatar
  • 1,749
5 votes

Joomla menu module - display levels in separate panels

I won't give you code on how to create a such menu, but I will give you an idea that will allow you to create a similar end result. You can create a "Split-Menu", by using 2 menu modules. At the ...
user avatar
  • 19.5k
5 votes

Default menu item undo

You can't "unset" the default page. As you mention, Joomla requires at least one menu item to be set as default. The solution is to set any other menu item as the default page by clicking ...
user avatar
  • 13.3k
4 votes
Accepted

How can I prevent a particular view in my Component from being available as a menu item?

This should be driven by xml files in the tmpl folder of the view. So for the default.php layout, you typically add a default.xml file to the same folder to make that layout available as a menu item. ...
user avatar
4 votes
Accepted

How to set up a menu icon in Joomla 3?

Answered my own question shortly after I wrote it. It was to do with the template. For some reason, the default ISIS template disables the icon view. If you are experiencing this problem, go to ...
user avatar
4 votes
Accepted

Undefined index: view with external url menu

I just had this issue myself. The problem was that the client had internal links that were not relative and were linking to the proper page but with these weird URLs. Once the internal links on the ...
user avatar
4 votes

How to create page only with modules and no component?

You can have multiple template layouts in your index file. <!--Layout 1--> <?php if ($BConfig->html=='layoutA') : ?> <jdoc:include type="component" /> <?php endif; ?> &...
user avatar
  • 1,328
4 votes
Accepted

Override a component view for a specific menu item

Method 1: Use the CSS class to make it work the way you describe. Add the class to the menu item (at the page display tab, write it in the "Page Class" field). Example: " special-page" (note the ...
user avatar
  • 855
4 votes

How to create a collapsible menu with Joomla! 3.3 and Bootstrap 3?

I struggled with this longer than I care to admit. My answer is based on Bootstrap 3.2.0 and it creates a collapsible dropdown menu for Joomla 3.3 In my template I included bootstrap.css and a ...
user avatar
  • 2,330
4 votes
Accepted

Module as menu item

Here's one alternative to load the search module in your menu. It requires a couple of simple steps: 1. Override your mod_menu module Create an override in your templates folder \templates\...
user avatar
  • 13.3k
4 votes
Accepted

New menu changes article URL

No, this is how Joomla's sef system works. If you were to make a menu item to an article, that too would lose its item id from the url. I think your only option would either be to override the router ...
user avatar
  • 2,366
4 votes
Accepted

Template's main menu not responsive -how to fix it?

The menu is there but due to the colour of the dropdown trigger, it's very hard to see as it's blending in with the background. The image below shows you: You can change the colour on line 80 of ...
user avatar
  • 26.4k
4 votes
Accepted

Joomla using bootstrap (mod_bootstrapnav) menu issue

Bootstrap and this module do not support three levels. You can check it in Bootstrap v2.3.2, navbar dropdowns definition: http://getbootstrap.com/2.3.2/javascript.html#dropdowns
user avatar
  • 7,415
4 votes

How to add separate admin menu for custom component

You will need to override the admin template to do this. There is a pretty detailed article here that describes how to do this. It was written for Joomla 2.5 but should also work for Joomla 3.0 http:...
user avatar
4 votes

How can I hide a menu item, without breaking its route?

Simply create Hidden Menu (call it whatever you want) which is not to be used in any menu module. It will hold menu items not visible on front end, and put your menu item in it.
user avatar
  • 3,017
4 votes

Add a parameter to "external url" menu item

The External URL menu item also has an XML file (like all backend forms in Joomla). You can find it inside: administrator/components/com_menus/models/forms/item_url.xml So inside this file (or the ...
user avatar
  • 19.5k
4 votes

Joomla turns all menu items to sub-sub-menu items when adding a new one

The issue was down to a problem with a PDO database file MySQL driver, which is why it wasn't replicated on my other 3.5.0 site, which was using MySql. There is a fix here, or it should be patched in ...
user avatar
  • 3,072

Only top scored, non community-wiki answers of a minimum length are eligible