User tests: Successful: Unsuccessful:
By editing of menu items there is a problem that you can't distinguish between menu items with the same title.
Example:
You have 2 menu items with the title "News", but they have different parents or belongs to different menus. By searching for "News" you will get 2 menu items without knowing, which menu item belongs to which parent menu item.
In order to select the right menu item, you need to write own aliases, which defines belogning to a parent menu item (See screenshots)
Joomla standard (current state):
My solution:
I added the aliases in the Menu Item and Parent Item dropdown field.
How to test:
1) Open some existing menu item or create a new menu item
2) Click_ Menu Item Type_ and select Menu Item Alias
3) Open the Menu Item OR Parent Item dropdown field and you will see aliases behind the titles
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
I have tested this item successfully on d835b5f
I can confirm the issue as described and this PR resolves the issue
But it looks very ugly with the line wraps etc and is actually harder to read now maybe the alias should be on a second line and even in italics
maybe the alias should be on a second line and even in italics
and/or a Bootstrap class in XML file for the field: input-large or input-xlarge ? They are nearly all too small.
But it looks very ugly with the line wraps etc and is actually harder to read now maybe the alias should be on a second line and even in italics
I agree but unfortunately, not possible (i think) to add HTML inside option tags as it is...
Does having menu item ID to replace too long alias could be easier ?
I dont think adding the ID would serve the intended purpose of this PR
I have tested this item successfully on d835b5f
Not pretty, but it helps a lot.
A quick(!) workaround(!) concerning linebreaks:
Add a newline "\n"
$titleAlias = "\n" . JText::_('JFIELD_ALIAS_LABEL') . ': ' . $db->escape($options[$i]->alias);
Replace newline by BR only if "chosened" select box (selector .chzn-done):
$options = array_merge(parent::getOptions(), $options);
$js = '
(function($){
$(window).load(function(){
$("#' . $this->id . '.chzn-done option").each(
function()
{
var html = $(this).html().replace(/\n/,"<br>");
$(this).html(html);
}
);
$("#' . $this->id . '").trigger("liszt:updated");
});
})(jQuery);
';
JFactory::getDocument()->addScriptDeclaration($js);
return $options;
I wanted to upload an image but since weeks now i get a message:
"Something went really wrong, and we can’t process that file."
@bertmert Great!!!
So, attached 2 screenshots (LTR and RTL) and minor changes of your code (html rendering).
I think @kesh52 that you could use it ? (code for menuparent, but should work the same for menuitem field)
Code menuparent.php (lines 78 -> 107):
// Pad the option text with spaces using depth level as a multiplier.
for ($i = 0, $n = count($options); $i < $n; $i++)
{
$titleAlias = "\n" . JText::_('JFIELD_ALIAS_LABEL') . ': ' . $db->escape($options[$i]->alias);
$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text . $titleAlias;
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
$js = '
(function($){
$(window).load(function(){
$("#' . $this->id . '.chzn-done option").each(
function(){
var arr = $(this).html().split(/\n/);
var html = arr[1] ? arr[0]+"<br />  <small>("+arr[1]+")</small>" : arr[0];
$(this).html(html);
}
);
$("#' . $this->id . '").trigger("liszt:updated");
});
})(jQuery);
';
JFactory::getDocument()->addScriptDeclaration($js);
return $options;
I'm not convinced that this solves the problem. You can have multiple menus
with the identical title AND alias as long as they have different parent
items. The screenshot from @joomlic (which does look better than the
original) wouldn't help determine which is the menu item you want to edit
On 18 Feb 2016 6:15 pm, "Cyril Rezé" notifications@github.com wrote:
@bertmert https://github.com/bertmert Great!!!
So, attached 2 screenshots (LTR and RTL) and minor changes of your code
(html rendering).
I think @kesh52 https://github.com/kesh52 that you could use it ? (code
for menuparent, but shuld work the same for menuitem field)[image: capture d ecran 2016-02-18 a 19 04 06]
https://cloud.githubusercontent.com/assets/2385058/13153257/6eefaf7a-d673-11e5-8553-f54a8379eb55.png [image:
capture d ecran 2016-02-18 a 19 06 57]
https://cloud.githubusercontent.com/assets/2385058/13153281/87510c08-d673-11e5-9730-d7c403f10665.pngCode menuparent.php (lines 78 -> 107):
// Pad the option text with spaces using depth level as a multiplier. for ($i = 0, $n = count($options); $i < $n; $i++) { $titleAlias = "\n" . JText::_('JFIELD_ALIAS_LABEL') . ': ' . $db->escape($options[$i]->alias); $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text . $titleAlias; } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); $js = ' (function($){ $(window).load(function(){ $("#' . $this->id . '.chzn-done option").each( function(){ var arr = $(this).html().split(/\n/); var html = arr[1] ? arr[0]+"<br />  <small>("+arr[1]+")</small>" : arr[0]; $(this).html(html); } ); $("#' . $this->id . '").trigger("liszt:updated"); }); })(jQuery); '; JFactory::getDocument()->addScriptDeclaration($js); return $options;
—
Reply to this email directly or view it on GitHub
#9086 (comment).
I'm not convinced that this solves the problem. You can have multiple menus with the identical title AND alias as long as they have different parent items. The screenshot from @joomlic (which does look better than the original) wouldn't help determine which is the menu item you want to edit
This why i thought first of menu item id...
Do you mean having parent menu item at the place of the alias ?
Something like this ?
That's the only solution to the original request but still won't really
solve it if you have a complex nested menu. I'm just not convinced that for
the number of users who have the problem it is worth spoiling the UI for
everyone else
On 18 Feb 2016 7:09 pm, "Cyril Rezé" notifications@github.com wrote:
I'm not convinced that this solves the problem. You can have multiple
menus with the identical title AND alias as long as they have different
parent items. The screenshot from @joomlic https://github.com/joomlic
(which does look better than the original) wouldn't help determine which is
the menu item you want to edit
This why i thought first of menu item id...
Do you mean having parent menu item at the place of the alias ?
Something like this ?
[image: capture d ecran 2016-02-18 a 20 09 07]
https://cloud.githubusercontent.com/assets/2385058/13154905/89d60c28-d67b-11e5-820a-28482437721e.png—
Reply to this email directly or view it on GitHub
#9086 (comment).
I tend to agree with Brian. It's an issue very specific to a setup.
There is actually a simple solution to the issue which doesn't need any code.
Just don't use the filtering and select the correct menu by scrolling through the list.
That's the only solution to the original request but still won't really solve it if you have a complex nested menu. I'm just not convinced that for the number of users who have the problem it is worth spoiling the UI for everyone else
I don't have yet other ideas (but this could give ones to others!) ;-)
In my opinion, even if 2 successful checks, this PR is not ready for RTC (display and RTL issues).
The way to solve original PR issue is using @bermert code (first screenshots with alias, as aim of this PR by @kesh52 ).
We can confirm the issue reported by @kesh52 , what is more difficult to determine is how to add the needed info to solve this (maybe only needed if using chosen search filtering the list of menu items ?)...
I tend to agree with Brian. It's an issue very specific to a setup.
There is actually a simple solution to the issue which doesn't need any code.
Just don't use the filtering and select the correct menu by scrolling through the list.
See your post after writing my last comment...
I agree that info is not needed in the select list, but maybe the heart of the problem is to add the info when using filtering only (the case this issue happens).
;)
I have tested this item unsuccessfully on d835b5f
Setting to Needs Review so the CMS maintainers can make a decision
Status | Pending | ⇒ | Needs Review |
Category | ⇒ | Administration |
The patch is not good yet if you ask me.
A menu-item alias can be the same is it in an other parent.
So when i not change the alias i still see exactly the same info
https://www.dropbox.com/s/obytw2akqgeqrv8/Screenshot%202016-04-15%2016.09.01.png?dl=0
I have tested this item successfully on d835b5f
Tested succesfully, menu-item-aliasses are nicely shown.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-07 13:46:27 |
Closed_By | ⇒ | roland-d |
Thank you all for your contribution. I am going to close this PR as it doesn't fully solve the issue nor is it a common issue. To really fix this problem we need a different GUI setup to properly see and select the right item.
It would be great if you could update your code as it failed the CI tests
FILE: ...libraries/cms/form/field/menuitem.php
FOUND 5 ERROR(S) AFFECTING 5 LINE(S)
198 | ERROR | Tabs must be used to indent lines; spaces are not allowed
199 | ERROR | Tabs must be used to indent lines; spaces are not allowed
200 | ERROR | Tabs must be used to indent lines; spaces are not allowed
201 | ERROR | Tabs must be used to indent lines; spaces are not allowed
202 | ERROR | Tabs must be used to indent lines; spaces are not allowed