User tests: Successful: Unsuccessful:
When working on the GSOC multilingual project joomla-projects/gsoc16_improved-multi-lingual#57 we needed to implement modals for the menu items.
To test (as the new field is not implemented elsewhere for now), create a simple multilingual site.
Create some menu items in different languages.
Edit a Menu Item, open the Associations Tab.
Instead of the dropdowns to choose a menu item you will now get the same interface as in other components.
Selecting will display a modal with forcedlanguage.
Editing will let edit the associated menu item in a modal.
This new feature will be handy to add for example a new editor_XTD to insert menu item links in contents, change in some cases the menuitem type to the new one, etc.
After patch, one will get:
Category | ⇒ | Administration Components Language & Strings |
Status | New | ⇒ | Pending |
Labels |
Added:
?
?
|
Category | Administration Components Language & Strings | ⇒ | Administration Components Language & Strings Multilanguage |
I have tested this item
Tested and it worked fine
From a usability perspective I was a little confused when I opened the modal to select a menu item and I kept getting empty results no matter which menu I was looking at.
I think it would be helpful if the modal title was changed from
Select or Change Menu Item
to
Select or Change %s Menu Item
where $s is the language
Or something like that
From a usability perspective I was a little confused when I opened the modal to select a menu item and I kept getting empty results no matter which menu I was looking at.
I agree with you. But all assocaition button list modals work like this.
I someone does a PR to change that, it need to change in com_content, com_categories, com_contact and com_newsfeeds modals also.
As I've never worked on a multilingual site other than when testing issues
its not something I came across before but it definitely needs changing
On 5 August 2016 at 12:31, andrepereiradasilva notifications@github.com
wrote:
From a usability perspective I was a little confused when I opened the
modal to select a menu item and I kept getting empty results no matter
which menu I was looking at.I agree with you. But all assocaition button list modals work like this.
I someone does a PR to change that, it need to change in com_content,
com_categories, com_contact and com_newsfeeds modals also.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11471 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8elJ7cQ8SKz_w7ABOUk2JOwDjtWOks5qcx8ngaJpZM4Jdj8a
.
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
yes - obviously it is only relevant when doing associations
On 5 August 2016 at 15:32, infograf768 notifications@github.com wrote:
Default of the modal Layout
Do you mean something like:[image: screen shot 2016-08-05 at 16 27 33]
https://cloud.githubusercontent.com/assets/869724/17439720/a734e5d6-5b29-11e6-8065-b630dcc29328.pngI guess we can do it in another general PR for all components concerned,
after this has neem merged.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11471 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8VCBAy7t6pldEBnzKwc9fQuxLX5Fks5qc0lkgaJpZM4Jdj8a
.
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
Labels |
Added:
?
|
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Labels |
I have tested this item
Labels |
Added:
?
|
I guess we can do it in another general PR for all components concerned, after this has been merged.
fully agree
one single step at time
Labels |
FYI, I already have updated this locally here in order to use it wherever the menuitem type is used in core.
It would take care of the differences between associations and other uses, not only for the Modal title but also for the default field (Select a Menu Item
OR Default
). Clear
true or false, etc.
It means there would be, among other necessary changes in various xml(s), some changes (conditionals) in the ROOT/administrator/components/com_menus/models/fields/modal/menu.php
file which is created in this PR.
diff --git a/administrator/components/com_menus/models/fields/modal/menu.php b/administrator/components/com_menus/models/fields/modal/menu.php
index afe8d9f..a4c00f1 100644
--- a/administrator/components/com_menus/models/fields/modal/menu.php
+++ b/administrator/components/com_menus/models/fields/modal/menu.php
@@ -88,8 +88,16 @@
$scriptClear = true;
+ if (isset($this->element['language']))
+ {
+ $clearField = htmlspecialchars(JText::_('COM_MENUS_SELECT_A_MENUITEM', true), ENT_COMPAT, 'UTF-8');
+ }
+ else
+ {
+ $clearField = htmlspecialchars(JText::_('JDEFAULT', true), ENT_COMPAT, 'UTF-8');
+ }
+
$script[] = ' function jClearMenu(id) {';
$script[] = ' document.getElementById(id + "_id").value = "";';
- $script[] = ' document.getElementById(id + "_name").value = "' .
- htmlspecialchars(JText::_('COM_MENUS_SELECT_A_MENUITEM', true), ENT_COMPAT, 'UTF-8') . '";';
+ $script[] = ' document.getElementById(id + "_name").value = "' . $clearField . '";';
$script[] = ' jQuery("#"+id + "_clear").addClass("hidden");';
$script[] = ' if (document.getElementById(id + "_edit")) {';
@@ -117,4 +125,9 @@
$linkItems .= '&forcedLanguage=' . $this->element['language'];
$linkItem .= '&forcedLanguage=' . $this->element['language'];
+ $modalTitle = JText::_('COM_MENUS_CHANGE_MENUITEM') . ' (' . $this->element['label'] . ')';
+ }
+ else
+ {
+ $modalTitle = JText::_('COM_MENUS_CHANGE_MENUITEM');
}
@@ -144,5 +157,12 @@
if (empty($title))
{
- $title = JText::_('COM_MENUS_SELECT_A_MENUITEM');
+ if (isset($this->element['language']))
+ {
+ $title = JText::_('COM_MENUS_SELECT_A_MENUITEM', true);
+ }
+ else
+ {
+ $title = JText::_('JDEFAULT');
+ }
}
@@ -195,5 +215,5 @@
'menuSelect' . $this->id . 'Modal',
array(
- 'title' => JText::_('COM_MENUS_CHANGE_MENUITEM'),
+ 'title' => $modalTitle,
'url' => $urlSelect,
'height' => '400px',
As the milestone is not set, I think it is better to wait to make such a full PR.
What do you think?
As it is a new feature the milestone will be 3.7
@andrepereiradasilva
while making a POC for a new editor_xtd
/plugins/editors-xtd/menu/menu.php
I had to change the modal to
data-uri="<?php echo 'index.php?Itemid=' . $item->id; ?>"
instead of
data-uri="<?php echo $this->escape(JRoute::_('index.php?Itemid=' . $item->id)); ?>"
as otherwise I was getting administrator/
in the link.
The new plugin works now fine here.
If I remember well, you did something about using JRoute in admin when targeting site.
I just wonder if we really need JRoute anyway here as I add the language in the plugin with:
$js = "
function jSelectMenuItem(id, title, tree, object, uri, language)
{
var thislang = '';
if (language !== '')
{
var thislang = '&lang=';
}
var tag = '<a href=\"' + uri + thislang + language + '\">' + title + '</a>';
jInsertEditorText(tag, '" . $name . "');
jModalClose();
}";
As we do not need a JRoute in our case and we do need to know if we are or not in multilang and if the language of the menu item is set to a content language, I modified the PR to fit.
To test how the new menu editor-xtd works, unzip this in the editors-xtd and discover it.
You will get a new button (without language strings) in TinyMCE when editing content. Just choose a menu item and look at the source in the editor.
Save and test in frontend.
Test in multilang and monolang.
menu.zip
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-19 13:44:45 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
I have tested this item✅ successfully on 10aecbf
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11471.