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();
$...
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 ...
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 ...
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::...
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()->...
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-&...
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 ...
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 ...
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 ...
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');
$...
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::...
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.
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="...
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 ...
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 ...
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::...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
menu-parameters × 32menu-item × 13
menu × 10
joomla-3.x × 8
component × 3
joomla-4.x × 3
development × 2
articles × 2
templates × 2
custom-component × 2
database × 2
category-blog × 2
variable × 2
component-params × 2
plugin × 1
extensions × 1
css × 1
custom-field × 1
ajax × 1
template-override × 1
seo × 1
module-display × 1
xml × 1
front-end × 1
view × 1