so the Menu Items list, parent filter if you have a 3 tired menu i.e.
Services
-Home Improvements
--Bathrooms
--Lounge
-House Cleaning
--Carpets
--Dusting
If you filter by parent menu item 'Services' you do not get the sub items. i.e. bathrooms, lounge, carpets, dusting.
Before I do any work to improve this, is this as the majority would expect? Or would you expect to on show what is directly under the parent?
Labels |
Added:
?
|
Status | New | ⇒ | Information Required |
Category | ⇒ | com_menus |
There is a use case for both options.
I am creating a dropdown menu structure -> I want to see all the level 1 menu items
I am working on one of those dropdowns and I want to see the parent and its children
The best solution for me would be if filter "Select Max Levels" would start at the level of the selected parent menu item.
We dont have a way to select it :(
So there is a bug, the max levels should still be taking effect within the parent filter and it's not. (I always miss that option)
On Sep 20 2018, at 2:48 pm, Brian Teeman notifications@github.com wrote:
There is a use case for both options.
I am creating a dropdown menu structure -> I want to see all the level 1 menu items
I am working on one of those dropdowns and I want to see the parent and its childrenThe best solution for me would be if filter "Select Max Levels" would start at the level of the selected parent menu item.
We dont have a way to select it :(—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/1537451629.local-3b4b8401-aadb-v1.4.2-f587b7b7@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2Fjoomla%2Fjoomla-cms%2Fissues%2F22271%23issuecomment-423189658&recipient=cmVwbHkrMDAxNTYwOTYwZTMwZWQ3ODk1OGQzMTBhYTkwMjVlOWNlNDY1YzJlZTlmOTM2ZGNlOTJjZjAwMDAwMDAxMTdiYjY3MjQ5MmExNjljZTE1OTU3ZWIyQHJlcGx5LmdpdGh1Yi5jb20%3D), or mute the thread (https://link.getmailspring.com/link/1537451629.local-3b4b8401-aadb-v1.4.2-f587b7b7@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABVglsBIPAkSNBmk7gXwwkmdghg3KoU2ks5uc5ylgaJpZM4Wx0kj&recipient=cmVwbHkrMDAxNTYwOTYwZTMwZWQ3ODk1OGQzMTBhYTkwMjVlOWNlNDY1YzJlZTlmOTM2ZGNlOTJjZjAwMDAwMDAxMTdiYjY3MjQ5MmExNjljZTE1OTU3ZWIyQHJlcGx5LmdpdGh1Yi5jb20%3D).
Sorry - I forgot there was a parent menu item select now
At the moment (3.9) it's like this: If a parent item is selected that is in level=1 or 2 and you set max. levels = 1 you get an empty list. I think also an empty list if you set it to 2. I'm too confused atm ;-)
I’ll see what I can do, I did add the parent filter after all. I just forgot about max levels
On Sep 20, 2018 at 5:23 pm, <ReLater (mailto:notifications@github.com)> wrote:
At the moment (3.9) it's like this: If a parent item is selected that is in level=1 or 2 and you set max. levels = 1 you get an empty list. I think also an empty list if you set it to 2. I'm too confused atm ;-)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#22271 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ABVglsSd4ySELzec1a2gHs_FtqBFnuAeks5uc8EQgaJpZM4Wx0kj).
Labels |
Added:
J3 Issue
|
If i understand the issue
we should have
Existing code
// Filter the items over the parent id if set.
$parentId = $this->getState('filter.parent_id');
if (!empty($parentId))
{
$query->where('a.parent_id = ' . (int) $parentId);
}
// ...
// ... this code will not change
// ...
// Filter on the level.
if ($level = $this->getState('filter.level'))
{
$query->where('a.level <= ' . (int) $level);
}
New code like:
// Filter the items over the parent id if set.
$parentId = $this->getState('filter.parent_id');
if (!empty($parentId))
{
$level = $this->getState('filter.level');
// Create a subquery for the sub-items list
$subQuery = $db->getQuery(true)
->select('sub.id')
->from('#__menu as sub')
->join('INNER', '#__menu as this ON sub.lft > this.lft AND sub.rgt < this.rgt')
->where('this.id = ' . (int) $parentId);
if ($level)
{
$subQuery->where('sub.level <= this.level + ' . (int) $level);
}
// Add the subquery to the main query
$query->where('(a.parent_id = ' . (int) $parentId . ' OR a.parent_id IN (' . (string) $subQuery . '))');
}
// Filter on the level.
elseif ($level = $this->getState('filter.level'))
{
$query->where('a.level <= ' . (int) $level);
}
i have made a PR,
thanks for bringing this up,
current behavior is a limitation that makes menu-item management harder
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-09-22 05:14:39 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_Date | 2018-09-22 05:14:39 | ⇒ | 2018-09-22 05:14:40 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/22271
Hard to say what's better. It depends on the number of sub item levels. The best solution for me would be if filter "Select Max Levels" would start at the level of the selected parent menu item.