We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

15

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 described on the docs here: http://docs.joomla.org/How_to_determine_if_the_user_is_viewing_the_front_page and do something like: <?php $menu = JFactory::...


10

.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 parent menu item. But sometimes you want to show just the first level in your main menu and show the other levels in a side menu, for example. .deeper is then ...


10

Try this code: $menu = JFactory::getApplication()->getMenu(); $parent = $menu->getItem( $menu->getActive()->parent_id ); $parentname = $parent->title If you need the link $parentlink = JRoute::_( $parent->link . '&Itemid=' . $parent->id );


10

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 JMenuSite Object $active = $menu->getActive(); // Load the Active Menu Item as an stdClass Object The $active is an object of the current menu item. ...


9

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 for the class attribute as well.


9

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 URL The default HTML output of the menu item is a link. <li class="item-120"><a href="#">External URL menu item</a></li> This is ...


7

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.


7

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> When clicked, it will take you to this anchor. If you wish to animate the transition with a smooth scroll, you can use jQuery, like so: jQuery(document)....


6

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 don't turn that off, you can turn off every module including the menu for the front page menu item and you'll end up with just a blank article. Stick 3 buttons ...


6

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 Protostar template (I know you're using Joomla 2.5, but it should work. If not, please post some of your HTML/CSS code.) ul.menu > li { /* Add some space between ...


6

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 point. This could be combined into a single SQL statement, but for clarity of what you're doing, run each of them UPDATE xxx_menu SET params = REPLACE( ...


6

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('hidemainmenu') ? false : true; // Render the module layout require JModuleHelper::getLayoutPath('mod_custommenu', $params->get('layout', 'default')); The ...


5

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


5

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 similar feature in SWMenu (we have a Pro license but I believe the feature is the same in the free version). With that we have the category structure in the menu'...


5

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 First Menu Module (main first-level module) you will set to show only up to level 1 menu-items, in the: Module settings -> Start Level & End Level At the ...


5

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 the grey star (or setting "Default Page" to "Yes"). This will remove the star from the other menu item automatically. Update: According to your screenshot (and as @Igor ...


4

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. Don't include the xml file and you should not see it in the options list when adding a menu item.


4

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 administrator/templates/isis/css/template.css and comment out the below: /*.nav-collapse .nav li a, .dropdown-menu a { background-image: none; }*/


4

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 page were resolved (relinked properly), the error that you've posted disappeared. Good luck!


4

You can have multiple template layouts in your index file. <!--Layout 1--> <?php if ($BConfig->html=='layoutA') : ?> <jdoc:include type="component" /> <?php endif; ?> <!--End Layout 1--> <!--Dynamically Generated Layout 2--> <?php if ($BConfig->html=='layoutB') : ?> <jdoc:include type="modules" name="...


4

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 space before the page class, without it it will append it to the component rendered output). I recommend using a class that can be used in more than one situation. ...


4

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 modified version of bootstrap.js More info about the modification at the bottom of this answer. I put the following code in my index.php file <!--Navigation-->...


4

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\YOURTEMPLATE\html\mod_menu\default_url.php. Copy the following contents to the file: default_url.php <?php /** * @package Joomla.Site * @subpackage ...


4

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 or use a sef plugin like sh404sef or Mijosef. The only other thing I can think of is to actually make the category menu item alias 9-cat1 but obviously if ...


4

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 styles.css in your template: nav a#pull { background-color: #283744; /* CHANGE ME */ display: block; position: relative; width: 100%; } I'm not ...


4

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


4

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://magazine.joomla.org/issues/item/721-Customizing-the-Admin-Menu


4

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.


4

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 corresponding override for it), you could add something like (within the <fields> </fields>: <fieldset name="custom" label="custom"> <...


4

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 the next update: https://github.com/joomla/joomla-cms/pull/9610


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