Skip to main content
3 votes

How to get the actual title of a Menu Type object?

Just in case it helps anyone, this is how I achieved it: $menu = $app->getMenu(); $active_item = $menu->getActive(); $loader = function ($menu_type) { $db = \JFactory::getDbo(); $...
Cédric Françoys's user avatar
3 votes

How to assign a different Joomla template style to subpages?

If your template is not in the list of the non-compatible templates/frameworks of this extension, I would suggest you to go with the Regular Labs Advanced Template Manager. Advanced Template Manager ...
FFrewin's user avatar
  • 19.8k
2 votes

Cannot order articles in the correct order

If you have your articles arranged in sub-categories they will be ordered by category first then by date. If this is the case, in your menu item set Category order: No ordering, Article Order: Oldest ...
John Pitchers's user avatar
2 votes

How to get menu parameters and itemid in component controller

To get Menu Params This one is perfect I was searching few hrs and this solve my issue of Joomla 3.6.5 & PHP 7.1 0: Using $this when not in object context Solution: $app = JFactory::...
RadiusTheme's user avatar
2 votes

How to get the actual title of a Menu Type object?

You can get the current menu item alias like so: $alias = JFactory::getApplication()->getMenu()->getActive()->alias; Update: $active = JFactory::getApplication()->getMenu()->...
FFrewin's user avatar
  • 19.8k
2 votes
Accepted

Cannot access protected property Joomla\CMS\Menu\MenuItem::$params

The $params instance variable of the MenuItem class is protected, so if you try and access it via $menu->params you will get a PHP exception - cannot access protected property. Use instead: $menu-&...
Robbie Jackson's user avatar
2 votes

How do I add a custom alt value to menu link type image?

Based on the extra information, that your menu item needs to have part of it displayed using to superscript something, my suggested solution is partially the reverse of what you're asking. Keep the ...
Patrick Jackson's user avatar
2 votes
Accepted

How to update database module params

Although you could do this by direct database operations, when performing CRUD operations on records of Joomla core components it's best to use the Joomla Table class functionality, as this enables ...
Robbie Jackson's user avatar
2 votes

setParam says method undefined

There are two places where this could be set. The app params and the menu item params. Which ones would be used depends on how component is coded. See example how params are handled in article view ...
Sharky's user avatar
  • 12k
1 vote

setParam says method undefined

I don't think you should be trying to set the parameter through the JApplication object, but instead via the component helper, like so: $menuParams = JComponentHelper::getParams('com_menus'); $...
Lodder's user avatar
  • 26.9k
1 vote

Count modules function in template not working correctly

Usually i get around these kind of problems with a small custom PHP function. You can include it in you template index.php function thereAreModules ($position) { $modules = JModuleHelper::...
herrmarek's user avatar
  • 111
1 vote

Count modules function in template not working correctly

Your module is always published. It counts even if it has no content. A feature to exclude empty modules when counting modules in template may get included in 4.0.
Sharky's user avatar
  • 12k
1 vote

How to use 'showon' with global settings in menu item parameter?

The interesting bit here, I think, is that the "Use Global" option leaves the field empty so this simple approach will work for you, but only as long as the global value is 0: showon="...
Arlen's user avatar
  • 802
1 vote

Params in Custom Component List View

Addendum: OP wants the menu item params accessible in the view, but he tries to override the component params var ($this->params) with the menu item params object/class. Which is unnecessary ...
Dennis Heiden's user avatar
1 vote

Params in Custom Component List View

You are getting $params from $state $state = $this->get('State'); This means the state must have $params populated in your model. Check if you are populating the $state with $params in your ...
Nagarjun's user avatar
  • 3,001
1 vote
Accepted

Params in Custom Component List View

It looks like you are trying to get the menu parameters for your current active menu. Try the following code, this hasn't been tested, I am giving you this reference from memory. $app = JFactory::...
Terry Carter's user avatar
  • 1,834
1 vote

How to assign a different Joomla template style to subpages?

There's a few ways you could do this. Here are two options: Option 1: Using a category blog. If we use the news example, do you require the parent category to be a list view (which uses a different ...
sigil's user avatar
  • 63

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